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

Find a Random Coord, place a chest there with loot

Discussion in 'Skript' started by ThatBraxGuy, Aug 1, 2017.

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

    ThatBraxGuy Member

    Joined:
    Aug 1, 2017
    Messages:
    2
    Likes Received:
    0
    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 (Skript):
    1. every 2 minutes:
    2.     if {dutchman} is true:
    3.         chance of 8%:
    4.             set {_lootloc} to the location at (random integer between -1250 and 1250), 255, (random integer between -1250 and 1250)
    5.             while block below y-coordinate of {_lootloc} is air:
    6.                 subract 1 from y-coordinate of {_lootloc}
    7.             broadcast "&lThe Dutchman has appeared at %{_lootloc}%!"
    8.             broadcast "&cWhat is it you most desire? The compass points you there."
    9.             loop all players:
    10.                 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.
     
Thread Status:
Not open for further replies.
Loading...