I was wondering if anyone had or could create a script that acts as a portal like in the map Shadows of Evil. Just a simple portal would be nice too. If the player touches it they get transported to another location. If any one could help it would be greatly appreciated
I was wondering if anyone had or could create a script that acts as a portal like in the map Shadows of Evil. Just a simple portal would be nice too. If the player touches it they get transported to another location. If any one could help it would be greatly appreciated
Here
Code Snippet
Plaintext
function player_teleporter_init() { player_tp = GetEntArray( "teleport_player", "targetname" ); for( i = 0; i < player_tp.size; i++ ) { player_tp[i] thread player_teleport(); } }
function player_teleport() { destination = GetEnt( self.target, "targetname" ); while(1) { self waittill( "trigger", player ); player SetOrigin( destination.origin ); player SetPlayerAngles( destination.angles ); } }
Create a trigger radius or trigger multiple then give it the KVP "teleport_player" "targetname". Now create a script origin, set its client KVP to server, and deselect it. Now select your trigger first, then your script_origin and hit w. Now you can select both and copy them as many times as you want. Changing the angle of the origin will change the player angle after tp'ing.
function player_teleporter_init() { player_tp = GetEntArray( "teleport_player", "targetname" ); for( i = 0; i < player_tp.size; i++ ) { player_tp[i] thread player_teleport(); } }
function player_teleport() { destination = GetEnt( self.target, "targetname" ); while(1) { self waittill( "trigger", player ); player SetOrigin( destination.origin ); player SetPlayerAngles( destination.angles ); } }
Create a trigger radius or trigger multiple then give it the KVP "teleport_player" "targetname". Now create a script origin, set its client KVP to server, and deselect it. Now select your trigger first, then your script_origin and hit w. Now you can select both and copy them as many times as you want. Changing the angle of the origin will change the player angle after tp'ing.
Thank you very much! Also I enjoyed your minecraft map it was really well made
First of all, thank you for this script. But it seems I am doing something wrong. Maybe I am forgeting something but this is my steps:
1. Paste your script in the bottom of my gsc file. 2. Create trigger_multiple or trigger_radius. 3. Create KVP(for trigger) named "teleport_player" to "targetname" value. 4. Create "script_origin". 5. Set KVP(for script_origin) named "client_server" to "ServerSide" value. 6. Select trigger, then select script and link them using W key.
After this I am trying to walk through my trigger, and nothing happens. I did something wrong? Sorry for being stupid, but I am rather new to this whole scripting thing.
First of all, thank you for this script. But it seems I am doing something wrong. Maybe I am forgeting something but this is my steps:
1. Paste your script in the bottom of my gsc file. 2. Create trigger_multiple or trigger_radius. 3. Create KVP(for trigger) named "teleport_player" to "targetname" value. 4. Create "script_origin". 5. Set KVP(for script_origin) named "client_server" to "ServerSide" value. 6. Select trigger, then select script and link them using W key.
After this I am trying to walk through my trigger, and nothing happens. I did something wrong? Sorry for being stupid, but I am rather new to this whole scripting thing.
Make sure you are calling the init script in your main function:
Code Snippet
Plaintext
function mainorwhateveritscalled() { thread player_teleporter_init(); }