set_entity_script(entity, script_name, trigger_type, triggerable_by_npc)
|Entity to update the script for.
|Name of the new script.
|When to trigger the script. This argument is only applicable to tiles (possible values are ENTER_TILE, STOP_ON_TILE, and EXIT_TILE, with a default value of ENTER_TILE).
|Determines whether or not NPCs can trigger the script.
Use the Set Entity Script function to change the behavior of an object after it has been interacted with or to remove its script so it can no longer be interacted with, for example a door that the player cannot close once opened.