Jump to content

Random items skript help


Imperial_Slav

Recommended Posts

Hello, I own an survival server with random items but i want to make skript only affects people who have turned on /toggle command if you can help me i would very appreciate it!

This is my current skript:

every 10 seconds in world "world":
    if {randomItems} is not set:
        add 1 of (random item out of all items) to inventory of players
command /toggle:
    trigger:
        if {randomItems} is not set:
            message "&d&lI&f&lTopics &8»  &fYou have &cdisabled &frandom items!"
            set {randomItems} to false
        else:
            message "&d&lI&f&lTopics &8»  &fYou have &aenabled &frandom items!"
            delete {randomItems}

If you can help me thanks again!

Link to comment
Share on other sites

Make a a variable perm person like {random::%player's uuid%} and set it to true or false when they do the toggle command. And loop all players and if the variable for the player is true, give them the item. Like

 

every 10 seconds:
	loop all players:
		if {random::%loop-player%} is true:

 

 

Next time ask skript questions here
https://forums.minehut.com/forum/18-discussion/

  • Thanks 1

Discord - tarna256

In-game name - _Tarna_

Website - https://tarna.dev
Paste Site: https://paste.tarna.dev

---------------------------------------------------------

[VIP] - 7/27/2020

Community Support - 7/8/20 | 11/3/20

Helper  - 11/3/20 - 2/21/21

Moderator - 2/21/21 - 5/17/21

❤️ - 5/17/21 - now

Moderator - 12/20/22 - now

---------------------------------------------------------

image.png.70849a9b84e0347ce107b8e3eaee312c.pngimage.png.2111009afbd8bef10966ba9ede35a199.png

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