Jump to content

Why isnt my skript working (it's supposed to give the player 1 out of 4 possible blocks or items with different chances every 10 seconds)


Vantant

Recommended Posts

So for the past few hours I have been Frankensteining a piece of skript code that is supposed to give the player 1 out of 4 possible blocks or items with different chances every 10 seconds. For some reason it doesn't work, If it's a simple fix that you know of, I'm sorry because I am not good at skript. If it's a hard fix, Im also sorry if this takes your time.

 

If you can possibly find the problem with this plz tell me!



Itemgiver.sk

Edited by Vantant
Link to comment
Share on other sites

Here you go! 

on join:
    while player is online:
        set {_online} to true

every 1 seconds:
    loop all players:
        if {_online} is true:
            set {_Random} to a random number between 1 and 4
            if {_Random} is 1:
                add 1 gold ingot to loop-player
            if {_Random} is 2:
                add 1 iron ingot to loop-player
            if {_Random} is 3:
                add 1 Emerald to loop-player
            if {_Random} is 4:
                add 1 Diamond to loop-player

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...