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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

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

Solved Need help with sort of testfor script

Discussion in 'Skript' started by Delano, Apr 24, 2018.

Thread Status:
Not open for further replies.
  1. Delano

    Delano Member

    Joined:
    Apr 15, 2018
    Messages:
    17
    Likes Received:
    2
    So I made this script:
    Code (Skript):
    1. #Dungeons
    2.  
    3. command /dungeon <text> <text> <text> [<text>] [<text>]:
    4.     trigger:
    5. #Spider Dungeon commands
    6.         arg-1 is "set":
    7.             if arg-2 is "cave":
    8.                 if arg-3 is "spider":
    9.                     if arg-4 is "Fura":
    10.                         if arg-5 is "entrance":
    11.                             set {Fura.Spider.Cave.entrance} to location of player
    12.                             message "<purple>[Dungeons] &eThe location of the cave has been set!" to player
    13.                     if arg-4 is "k2":
    14.                         if arg-5 is "entrance":
    15.                             set {k2.Spider.Cave} to location of player
    16.                     if arg-4 is "k3":
    17.                         if arg-5 is "entrance":
    18.                             set {k3.Spider>cave} to location of player
    19.         arg-1 is "teleport":
    20.             if arg-2 is "Fura":
    21.                 if arg-3 is "spider":
    22.                     if arg-4 is "cave":
    23.                         teleport player to {Fura.Spider.Cave}
    24.                         message "<purple>[Dungeons] &eYou have been teleported to the cave!" to player
    25.             if arg-2 is "k2":
    26.                 if arg-3 is "spider":
    27.                     if arg-4 is "cave":
    28.                         teleport player to {k2.Spider.Cave}
    29.             if arg-2 is "k3":
    30.                 if arg-3 is "spider":
    31.                     if arg-4 is "cave":
    32.                         teleport player to {k3.Spider.Cave}
    33.  
    34. #Spider Dungeon trigger
    35. on join:
    36.     wait 1 tick
    37.     while player is alive:
    38.         if {Fura.Spider.Cave.entrance} is in radius 1 of the player:
    39.             damage player by 1.0
    40.             message "Put here your message."
    41.         wait 1 second
    But the "if {Fura.Spider.Cave.entrance} is in radius 1 of the player:" is obviously not working
    So I need the right line for this to loop if someone is on {Fura.Spider.Cave.entrance} and excecute those commands

    Thanks
     
  2. JustADev

    JustADev Well-Known Member

    Joined:
    Apr 8, 2017
    Messages:
    380
    Likes Received:
    9
    Code (Skript):
    1. if player is in radius 1 of {Fura.Spider.Cave.entrance}:
    2.     #do Stuff
    Also why are you using, "While player is alive", I mean, once they join, they should be alive... :emoji_thinking:
     
  3. Delano

    Delano Member

    Joined:
    Apr 15, 2018
    Messages:
    17
    Likes Received:
    2
    I actually don't know.. I pasted some stuff from the forums and edited some bits.
    Thanks for the line though, only thing is what event can I use instead of "on join" so the loop always runs
    --- Double Post Merged, Apr 24, 2018, Original Post Date: Apr 24, 2018 ---
    or maybe something like this:
    Code (Skript):
    1. on join:
    2.     loop all players in radius 5 of {Fura.Spider.Cave.entrance}:
    3.         message "&ehi" to player
    but this still doesn't work because it can't understand this loop
     
  4. Mr_Simba

    Mr_Simba King of the Pridelands
    Moderator Supporter

    Joined:
    Dec 9, 2016
    Messages:
    257
    Likes Received:
    55
    Medals:
    I agree that this code could use more work as a whole, but to answer your specific question, instead of this:
    Code (Skript):
    1. if {Fura.Spider.Cave.entrance} is in radius 1 of the player:
    Do this
    Code (Skript):
    1. if distance between player and {Fura.Spider.Cave.entrance} <= 1:
     
  5. Delano

    Delano Member

    Joined:
    Apr 15, 2018
    Messages:
    17
    Likes Received:
    2
    hmm.. I tried this and this is now my new script:
    Code (Skript):
    1. every 1 second in world "Xantos":
    2.     loop all players:
    3.         if distance between player and {Fura.Spider.Cave.entrance} <= 2:
    4.             send "hi" to loop-player
    but when I set the variable to the location and I'm walking into it nothing seems to work but I don't get any errors..
    --- Double Post Merged, Apr 26, 2018, Original Post Date: Apr 25, 2018 ---
    Nevermind I forgot to set player to loop-player
    it's fixed now. thanks!
     
    • Like Like x 1
Thread Status:
Not open for further replies.

Share This Page

Loading...