1. Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Random TP

Discussion in 'Requests' started by iCritiqing, Sep 15, 2017.

  1. iCritiqing

    iCritiqing Member

    Joined:
    Jul 4, 2017
    Messages:
    13
    Likes Received:
    0
    Skript Version: Skript 2.2 (dev20c)
    Skript Author: Bensku
    Minecraft Version: 1.8.9

    Hello guys, i'm kinda new to Skript
    Can you guys show me how to randomly teleports yourself to another player that doesn't have a specific permission?

    Example:
    When you rightclick a blaze rod, you automaticly teleports to a random player that doesn't have the permission "skript.isastaff"

    Troubleshooting:

    Have you tried searching the docs? Yes
    Have you tried searching the forums? No
    What other methods have you tried to fix it? I have tried to google it but i don't find the perfect one

    Thanks :emoji_grinning:

     
  2. Best Answer:
    Post #6 by ShaneBee, Sep 16, 2017
  3. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    You can try with this
    Code (Skript):
    1. on right click with blaze rod:
    2.     teleport player to a random element out of all players
     
  4. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    thanks :emoji_grinning:

    But i want it to make the players that have a specific permissions wont be teleported to
     
  5. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Code (Skript):
    1. on right click with blaze rod:
    2.     loop all players:
    3.         if loop-player don't has permission "skript.isastaff":
    4.             add loop-player to {_Random::*}
    5.     if {_Random::*} is set:
    6.         teleport player to random element out of {_Random::*}
    7.     else:
    8.         send "Sorry, there is no player without permission online."
     
  6. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Thanks <3

    Edit:
    It doesn't teleport me...
    and it doesn't send me the "no players without permissions online" message...
    There was an error but i fixed it, i only changed the "has" to "have" and the error disapears
    but it still doesn't teleports me...
     
    #5 ShaneBee, Sep 16, 2017
    Last edited by a moderator: Sep 16, 2017
  7. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Code (Skript):
    1. on right click with blaze rod:
    2.     loop all players:
    3.         loop-player doesn't have permission "skript.isastaff":
    4.             add loop-player to {_random::*}
    5.     {_random::*} is set:
    6.         set {_} to random element out of {_random::*} parsed as player
    7.         teleport player to {_}
    8.     else:
    9.         send "Sorry, there is no player without permission online."
     
  8. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Nope still not working D:
     
  9. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    do you have permission? Is other player online there? Maybe youre teleporting evertime to your self
     
  10. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Tested by myself. All is working.
     
  11. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    So now it works...
    maybe i pasted it wrongly
     

Share This Page

Loading...