How is this script triggered? Tileset changing RMXP

Can anyone tell me what and where I place the trigger command for this script please?

Spoiler
#====================================
# Phylomortis Script, Ryethe. Rewrite: Leon_Westbrooke
#------------------------------------------------------------------------
# Game_Map and Spriteset_Map are aliased
# To call $game_map.replace_tileset(x), where x is the ID number of the new tileset.
#====================================

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Game_Map
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class Game_Map
attr_accessor :new_tileset

alias leon_gm_tileset_setup setup

def setup(map_id)
@new_tileset = false
leon_gm_tileset_setup(map_id)
end

def replace_tileset(new_tiles)
tileset = $data_tilesets[new_tiles]
@tileset_name = tileset.tileset_name
@autotile_names = tileset.autotile_names
@panorama_name = tileset.panorama_name
@panorama_hue = tileset.panorama_hue
@fog_name = tileset.fog_name
@fog_hue = tileset.fog_hue
@fog_opacity = tileset.fog_opacity
@fog_blend_type = tileset.fog_blend_type
@fog_zoom = tileset.fog_zoom
@fog_sx = tileset.fog_sx
@fog_sy = tileset.fog_sy
@battleback_name = tileset.battleback_name
@passages = tileset.passages
@priorities = tileset.priorities
@terrain_tags = tileset.terrain_tags
$game_map.new_tileset = true
end
end

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Spriteset_Map
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class Spriteset_Map

alias leon_sm_tileset_update update

def update
if $game_map.new_tileset == true
@tilemap.tileset = RPG::Cache.tileset($game_map.tileset_name)
@tilemap.priorities = $game_map.priorities
for i in 0..6
autotile_name = $game_map.autotile_names
@tilemap.autotiles = RPG::Cache.autotile(autotile_name)
end
$game_map.new_tileset = false
end
leon_sm_tileset_update
end
end
I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.


Please use meaningful titles for your threads (everyone who posts - when they post in the right place - needs "a little help" with something). Also, do not copy/paste scripts into your post. If you have a link to where you got the script from, please include that, as it will contain extra information that will be useful.


Please also clarify what engine you are using. You posted in the RMXP Scripts forum, which indicates that it's an XP script that you're using. But your profile says you're using VX Ace. If you ARE using Ace and it IS an XP script, it's not going to work anyway.
Sorry bout that! Yes I am using XP as well as VX ace.

here is the script webpage http://www.gdunlimited.net/forums/topic/2051-change-map-tileset/
The command is a script command, so it would have to be placed inside the event command "script" if you're trying to use it

Third page, bottom right
The command is a script command, so it would have to be placed inside the event command "script" if you're trying to use it

Third page, bottom right
Thank you!
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/how-is-this-script-triggered-tileset-changing-rmxp.50708/