So... we see you haven't signed up here on our website.  

Do you really want to sit here and be "Unregistered" all your life?  No, of course you don't!  So, click this here link and you'll take that all important first step into enlightenment! (or something, whatever...)

Simple Teleport for spawn

Discussion in 'General' started by DR SATAN, Feb 16, 2018.

  1. DR SATAN

    DR SATAN New Member

    Points:
    27
    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
     
  2. Trekkan

    Trekkan JFF Administrator Staff Member

    Points:
    1,232
    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.
     
  3. DR SATAN

    DR SATAN New Member

    Points:
    27

    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
     

    Attached Files:

    • ss1.JPG
      ss1.JPG
      File size:
      83.6 KB
      Views:
      9
    • ss2.JPG
      ss2.JPG
      File size:
      75 KB
      Views:
      10
  4. Trekkan

    Trekkan JFF Administrator Staff Member

    Points:
    1,232
    That looks good, but the teleport coords, don't pad them with the zeros. Just put them as the numbers you see in the game. =)
     
  5. DR SATAN

    DR SATAN New Member

    Points:
    27
    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 :/
     
  6. Trekkan

    Trekkan JFF Administrator Staff Member

    Points:
    1,232
    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.
     
  7. DR SATAN

    DR SATAN New Member

    Points:
    27
    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
     
  8. Trekkan

    Trekkan JFF Administrator Staff Member

    Points:
    1,232
    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!
     
  9. DR SATAN

    DR SATAN New Member

    Points:
    27
    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: Feb 19, 2018
  10. Trekkan

    Trekkan JFF Administrator Staff Member

    Points:
    1,232
    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.
     
  11. DR SATAN

    DR SATAN New Member

    Points:
    27
    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}
     
  12. Trekkan

    Trekkan JFF Administrator Staff Member

    Points:
    1,232
    Ahh crap, I did make that mistake! Sorry about that, but nice work figuring it out! =)
     

Share This Page