UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Teleporter not working

broken avatar :(
Created 11 years ago
by Deleted User
0 Members and 1 Guest are viewing this topic.
2,264 views
broken avatar :(
  • DeletedUser
  • Deleted Member
×
broken avatar :(
DeletedUser
This user is deleted :(
So with help of sajeone i made a teleporter which teleports the player for free and the only thing it doesnt do is setting player position (basically setorigin doesnt want to work)
Script: http://pastebin.com/vhV2rk0Z
Code Snippet
Plaintext
teleporter1_think()
{
teleportUse = getEnt("teleport1_trigger", "targetname");
teleportMultiple = getEnt("teleport1_multiple","targetname");
teleportTarget = getEntArray("teleporter1_targetspawn","targetname");
teleportUse setHintString("Press &&1 to teleport");
while(1)
{
teleportUse waittill("trigger");
players = get_players();
for(i=0;i<players.size;i++)
{
if(players[i] IsTouching(teleportMultiple)){
players[i] setOrigin(teleportTarget[i].origin);
players[i] ShellShock("electrocution", 1, true);
}
}
earthquake( 1, 2, teleportTarget[0], 1000);
SetTimescale(0.1);
wait(1);
SetTimescale(1);
}
}
broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 8 months ago
Posts
5,551
Respect
6,691Add +1
Forum Rank
Immortal
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
Signature
If Java had true garbage collection, most programs would delete themselves upon execution.
×
treminaor's Groups
UGX Administrator
UGX Team Member
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
Does the shellshock part happen? If so, your teleportTarget origin is probably not defined. If the shellshock part doesn't happen either, then your isTouching check is not working, most likely because telepoyrtMultiple is undefined. Add some iPrintLn's and isDefined() if you have to for debugging.
broken avatar :(
×
broken avatar :(
Location: usUnited States
Date Registered: 29 July 2013
Last active: 5 months ago
Posts
27
Respect
Forum Rank
Legless Crawler
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
greenlungs81's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
y not just copy the ones out of the tutorial and make it look like u want
broken avatar :(
  • DeletedUser
  • Deleted Member
×
broken avatar :(
DeletedUser
This user is deleted :(
Does the shellshock part happen? If so, your teleportTarget origin is probably not defined. If the shellshock part doesn't happen either, then your isTouching check is not working, most likely because telepoyrtMultiple is undefined. Add some iPrintLn's and isDefined() if you have to for debugging.
The shellshock part happen succesfully and im pretty sure that I properly targetnamed the script_structs.
broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 8 months ago
Posts
5,551
Respect
6,691Add +1
Forum Rank
Immortal
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
×
treminaor's Groups
UGX Administrator
UGX Team Member
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
The shellshock part happen succesfully and im pretty sure that I properly targetnamed the script_structs.
You can't use getEntArray with structs. You use getStructArray.
broken avatar :(
  • DeletedUser
  • Deleted Member
×
broken avatar :(
DeletedUser
This user is deleted :(
You can't use getEntArray with structs. You use getStructArray.
Renamed. Compiling the map right now. Ill let you know if it worked.

Post Merge: August 15, 2013, 08:13:42 pm
Worked! Thanks! My map is near finished!

 
Loading ...