Jump to content

Random item at interval (request)


sulf

Recommended Posts

Hey!

So, i want a skript that places a new item in a players inventory at a set interval, with all items possible. I have one at the moment, but if a player is moving an item as they get a new item from the skript, the item they're moving vanishes. 

My current skript for reference: 

every 15 seconds:
    loop all players:
        give loop-player 1 of random items out of all item

Link to comment
Share on other sites

every 15 seconds:
	loop all players
		set {_random} to random element out of all items
		give player {_random}

 

  • Thanks 2

 

Owner of play.hiveminez.net

 

⊱------------------------------⊰

Joined Minehut on 1/28/2021 (Same day I got Minecraft)

[VIP] - 3/14/2021

[LEGEND] - 5/27/2021

⊱------------------------------⊰

Discord - NotKaizo#0001

In-game name - iKaizo_

If you need any help, feel free to contact me.

Link to comment
Share on other sites

#-=-=-=-=-=-=-=-=-=-=-
#   Skript Made By:
#     S1LENT_EG
#-=-=-=-=-=-=-=-=-=-=-

every 15 seconds:
    loop all players:
        if {_grant} is true:
            give loop-player a random element of all items
            
command /randomitem [<text>]:
    permission: randomitem.player
    trigger:
        if arg-1 is "on":
            set {_grant} to true
            send "&fRandom item generator is now &aOn" to player
        if arg-1 is "off":
            set {_grant} to false
            send "&fRandom item generator is now &cOFF" to player

 


Commands:

/randomitem ON

/randomitem OFF


This skript has a ON/OFF

Hope this helps!

 

Edited just now by __S1LENT__
  • Thanks 1
  • Haha 1

"The sun wont stop for no one"

Link to comment
Share on other sites

On 10/7/2021 at 11:29 AM, S1LENT_EG said:

#-=-=-=-=-=-=-=-=-=-=-
#   Skript Made By:
#     S1LENT_EG
#-=-=-=-=-=-=-=-=-=-=-

every 15 seconds:
    loop all players:
        if {_grant} is true:
            give loop-player a random element of all items
            
command /randomitem [<text>]:
    permission: randomitem.player
    trigger:
        if arg-1 is "on":
            set {_grant} to true
            send "&fRandom item generator is now &aOn" to player
        if arg-1 is "off":
            set {_grant} to false
            send "&fRandom item generator is now &cOFF" to player

 


Commands:

/randomitem ON

/randomitem OFF


This skript has a ON/OFF

Hope this helps!

 

Edited just now by __S1LENT__

Won't work. You need to use a global variable instead of local.

  • Like 1

 

Owner of play.hiveminez.net

 

⊱------------------------------⊰

Joined Minehut on 1/28/2021 (Same day I got Minecraft)

[VIP] - 3/14/2021

[LEGEND] - 5/27/2021

⊱------------------------------⊰

Discord - NotKaizo#0001

In-game name - iKaizo_

If you need any help, feel free to contact me.

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