Jump to content

I need help with a skript


NoPulp

Recommended Posts

I want to make a skript where every few seconds you get a item out of a selection of items but the only thing i could 
find was this and its not working.
command /toggle
  trigger:
  if {toggleoff::%player%} exists:
     delete {toggleoff::%player%}
    else:
     set {toggleoff::%player%} to true

every 15 seconds:
  loop all players
    if {toggleoff::%loop-player%} does not exist:
      loop until {item::%loop-player%} is true:
        chance of 90%:
          give loop-player 1 of dirt
          set {item::%loop-player%} to true
          stop
        chance of 80%:
          give loop-player 1 of oak_wood
          set {item::%loop-player%} to true
          stop
        delete {item::%loop-player%}
Link to comment
Share on other sites

This should do what you want : )

 

every 15 seconds:
    loop all players:
        set {_num} to a random integer between 1 and 3:
            if {_num} is equal to 1:
                give 1 dirt to loop-player
            else if {_num} is equal to 2:
                give 1 stone to loop-player
            else if {_num} is equal to 3:
                give 1 gold ingot to loop-player

Link to comment
Share on other sites

@NoPulp of course! 🙂

every 15 seconds:
    loop all players:
        chance of 25%:
            set {_num} to a random integer between 1 and 3
            if {_num} is equal to 1:
                give 1 dirt to loop-player
            else if {_num} is equal to 2:
                give 1 stone to loop-player
            else if {_num} is equal to 3:
                give 1 gold ingot to loop-player

Edited by S_Mango
Link to comment
Share on other sites

@NoPulp 

This skript you can get multiple or none of the items

every 15 seconds:
    loop all players:
        chance of 25%:
            give 1 gold ingot to loop-player
        chance of 50%:
            give 1 stone to loop-player
        chance of 80%:
            give 1 dirt to loop-player

This skript means you will always get 1 item every 15 seconds but gold is the rarest and dirt is the most common 🙂 

every 15 seconds:
    loop all players:
        set {_Gifted} to "false"
        while {_Gifted} is not equal to "true":
            chance of 25%:
                give 1 gold ingot to loop-player
                set {_Gifted} to "true"
            if {_Gifted} is not equal to "true":
                chance of 50%:
                    give 1 stone to loop-player
                    set {_Gifted} to "true"
            if {_Gifted} is not equal to "true":
                chance of 80%:
                    give 1 dirt to loop-player
                    set {_Gifted} to "true"

Edited by S_Mango
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...