Find a Random Coord, place a chest there with loot

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

ThatBraxGuy

Member
Aug 1, 2017
2
0
0
28
Hello! I'm trying to write a skript that finds a random coord on the surface, places a chest there with some customizable loot, strike lightning there, point players compasses toward it, and place a few mobs around the chest to "guard" it.

This is what I have so far, but I'm not sure that it will work

code_language.skript:
every 2 minutes:
    if {dutchman} is true:
        chance of 8%:
            set {_lootloc} to the location at (random integer between -1250 and 1250), 255, (random integer between -1250 and 1250)
            while block below y-coordinate of {_lootloc} is air:
                subract 1 from y-coordinate of {_lootloc}
            broadcast "&lThe Dutchman has appeared at %{_lootloc}%!"
            broadcast "&cWhat is it you most desire? The compass points you there."
            loop all players:
                set the loop-player's compass target to location of {_lootloc}

Will this work? What can I do to fix it? Still getting back into skript. Any help appreciated.
 
Status
Not open for further replies.