======Set Entity Script====== ---- Sets the script of the specified [[tile]] or [[object]]. An empty [[string]] value can be specified for the [[script]] name in order to remove the [[entity|entity's]] [[script]]. The [[script]] name is case-sensitive. ====Signature:==== set_entity_script(entity, script_name, trigger_type, triggerable_by_npc) ^Argument^Description^Type^Required^ |entity|[[Entity]] to update the [[script]] for.|[[Entity]]|Yes| |script_name|Name of the new [[script]].|[[String]]|Yes| |trigger_type|When to trigger the [[script]]. This argument is only applicable to [[tile|tiles]] (possible values are ENTER_TILE, STOP_ON_TILE, and EXIT_TILE, with a default value of ENTER_TILE).|Trigger Type|No| |triggerable_by_npc|Determines whether or not [[npc|NPCs]] can trigger the [[script]].|[[Boolean]]|No| ====Example:==== set_entity_script(entity["chest01"], "empty_chest"); //Results:// The [[script]] for [[entity]] "chest01" is removed and replaced with the "empty_chest" [[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. ---- ====Editor Node:==== {{:wiki:set_entity_script_node.png?nolink|}} ====Visual Demo:==== {{:wiki:set_entity_script_demo.gif?nolink|}} ~~NOTOC~~