Simple Teleport for spawn

DR SATAN

New member
Feb 16, 2018
11
0
0
38
United States of America
OK so i am a noob when it comes to scripting. i know a few things but not enuff.

I have a PVE server and i want people to be able to type !spawn and git teleported to a set of cords i have... BUT i have no idea how to write it please help!

thank you
Dr Satan
 
The best way to do this would be to go into the teleport tab in RAT, and add a new teleport there to the location you want. Name it something like "spawn" without the quotes.

Now create a new RAT event:

Type: Player Public Chat
Conditionals: STARTSWITH:!spawn||COOLDOWN:1H
Script: teleportplayer {{player_steamid}} {{tele_spawn}}

Also, once you add a teleport that way, you can always right click a player in the player list and teleport them to that specified location.
 
The best way to do this would be to go into the teleport tab in RAT, and add a new teleport there to the location you want. Name it something like "spawn" without the quotes.

Now create a new RAT event:

Type: Player Public Chat
Conditionals: STARTSWITH:!spawn||COOLDOWN:1H
Script: teleportplayer {{player_steamid}} {{tele_spawn}}

Also, once you add a teleport that way, you can always right click a player in the player list and teleport them to that specified location.


thankyou for the help and reply just need a little more help :/

So i made a new teleport destination with cords of 0018 0004 0003 gitting this from the msg i git when i use !at it gives me cords of the saved location. i noticed in teleport destinations it gives cords format with XXXX XXXX XXXX so i assume the number has to be 4 digits even if there are 0's?

i have added a few ss on what i have done and do greatly apreceate the help i am learning something mostly new to me ! :D
 

Attachments

  • ss1.JPG
    ss1.JPG
    83.6 KB · Views: 21
  • ss2.JPG
    ss2.JPG
    75 KB · Views: 32
ok adjusted with no zeros but still is not working when i type !spawn in-game. i i need to restart the server or refresh a cfg? I can right click on my name in the player tab and select to teleport to the spawn that works fine just not the !spawn command :/
 
ok adjusted with no zeros but still is not working when i type !spawn in-game. i i need to restart the server or refresh a cfg? I can right click on my name in the player tab and select to teleport to the spawn that works fine just not the !spawn command :/

Ok, if it works when you right click it, that means you setup the teleport correctly.

When you type the !spawn command, check in the console and see if there any errors, also in the console, change the dropdown to RAT Logs and see if there are errors related to this command as well. That should help troubleshoot.
 
ok so i checked consol as i typed !spawn in game and nothing at all, even in the RAT logs doesn't display any errors while typing !spawn. Under the chat tab, i do git "Chat test args. Player Name: "DR SATAN"" after i type !spawn. but that's it
 
ok so i checked consol as i typed !spawn in game and nothing at all, even in the RAT logs doesn't display any errors while typing !spawn. Under the chat tab, i do git "Chat test args. Player Name: "DR SATAN"" after i type !spawn. but that's it

There's a default event in there that should not be enabled. That's my fault. Please check the player public chat events. TGhen disable the one that has the "Chat test args." in it. That should hopefully fix the issue. Sorry about that!
 
all good that helps me lear more about it :D but i am gitting an error msg now

Error in parsing: 2018-02-19T04:49:32 17026.682 INF Chat 'DR SATAN':!spawn
Playername or entity/steam id not found

so i changed player_steamid to player_name it finds me now but am getting

"The given x coordinate is not a valid integer.

do i need to add the name of the teleport in the scrips or is that "tele_spawn" what identifies were to tp the player? right clicking on my name and teleporting me to it still works fine
 
Last edited:
all good that helps me lear more about it :D but i am gitting an error msg now

Error in parsing: 2018-02-19T04:49:32 17026.682 INF Chat 'DR SATAN':!spawn
Playername or entity/steam id not found

so i changed player_steamid to player_name it finds me now but am getting

"The given x coordinate is not a valid integer.

do i need to add the name of the teleport in the scrips or is that "tele_spawn" what identifies were to tp the player? right clicking on my name and teleporting me to it still works fine

Since you are using player name now, and player names can have spaces in them (such as yours), you'll want to include two braces around the variable, such as: {{player_name}}. This will automatically enclose the name in double quotes. That should fix your problem.
 
yeah it still has the double brackets and was still not working I did figure it out tho.

in the original post, you included {{tele_spawn}}. after looking at examples of other teleport scripts there was only one { to open and close the destination. so i changed it to {tele_spawn} instead of {{tele_spawn}} and it all not works great!

thank you so much for the help I have learned a lot!

END RESULT

STARTSWITH:!spawn


teleportplayer {{player_name}} {tele_spawn}