Solved Need help with sort of testfor script

  • 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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Delano

Member
Apr 15, 2018
17
2
0
25
So I made this script:
code_language.skript:
#Dungeons

command /dungeon <text> <text> <text> [<text>] [<text>]:
    trigger:
#Spider Dungeon commands
        arg-1 is "set":
            if arg-2 is "cave":
                if arg-3 is "spider":
                    if arg-4 is "Fura":
                        if arg-5 is "entrance":
                            set {Fura.Spider.Cave.entrance} to location of player
                            message "<purple>[Dungeons] &eThe location of the cave has been set!" to player
                    if arg-4 is "k2":
                        if arg-5 is "entrance":
                            set {k2.Spider.Cave} to location of player
                    if arg-4 is "k3":
                        if arg-5 is "entrance":
                            set {k3.Spider>cave} to location of player
        arg-1 is "teleport":
            if arg-2 is "Fura":
                if arg-3 is "spider":
                    if arg-4 is "cave":
                        teleport player to {Fura.Spider.Cave}
                        message "<purple>[Dungeons] &eYou have been teleported to the cave!" to player
            if arg-2 is "k2":
                if arg-3 is "spider":
                    if arg-4 is "cave":
                        teleport player to {k2.Spider.Cave}
            if arg-2 is "k3":
                if arg-3 is "spider":
                    if arg-4 is "cave":
                        teleport player to {k3.Spider.Cave}

#Spider Dungeon trigger
on join:
    wait 1 tick
    while player is alive:
        if {Fura.Spider.Cave.entrance} is in radius 1 of the player:
            damage player by 1.0
            message "Put here your message."
        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
 
code_language.skript:
if player is in radius 1 of {Fura.Spider.Cave.entrance}:
    #do Stuff

Also why are you using, "While player is alive", I mean, once they join, they should be alive... :emoji_thinking:
 
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
[doublepost=1524580490,1524580048][/doublepost]or maybe something like this:
code_language.skript:
on join:
    loop all players in radius 5 of {Fura.Spider.Cave.entrance}:
        message "&ehi" to player

but this still doesn't work because it can't understand this loop
 
I agree that this code could use more work as a whole, but to answer your specific question, instead of this:
code_language.skript:
if {Fura.Spider.Cave.entrance} is in radius 1 of the player:
Do this
code_language.skript:
if distance between player and {Fura.Spider.Cave.entrance} <= 1:
 
hmm.. I tried this and this is now my new script:
code_language.skript:
every 1 second in world "Xantos":
    loop all players:
        if distance between player and {Fura.Spider.Cave.entrance} <= 2:
            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..
[doublepost=1524736252,1524682693][/doublepost]Nevermind I forgot to set player to loop-player
it's fixed now. thanks!
 
  • Like
Reactions: Mr_Simba
Status
Not open for further replies.