CS2D
Scripts Teleporting Players with Trigger_If Teleporting Players with Trigger_If
1 reply Hey guys! I was just asking how to teleport players using the trigger, Trigger_If. I will use the trigger to make an elevator and this is elevator plan:
Trigger_Use > Trigger_If (with teleport script)
If you know how to do this, please let me know. Thanks! DC Admin Offline
This is either a maps section or a scripts section topic but no general section topic. Moved.
We had a thread like that in the German section recently. Here are the problems:
trigger_if is designed to be used for simple conditions / evaluations. It's not designed to run complex Lua scripts or scripts which actually do something. That's why it is called trigger_if and not trigger_lua or whatever. That's also why the text box is so small.
trigger_if doesn't know who used the trigger_use! That's a big problem because we need that info!
Solution:
Forget trigger_if. You should write a Lua map script instead and use appropriate hooks. In this case usebutton. A Lua map script is simply a script which is placed into the maps folder and has the same name as the map but a .lua extension instead of a .map extension. It is automatically executed on the server when the map is loaded.