Ok so i want to make a gen (kinda) skript, so basically when the player right click a music disc it will active or we can say the variable turn to true, and when its activate it will give player an iron block every 4 seconds, but the problem is im using "loop all players" and that make the every 4 seconds give player item effect work when all of the player on the server turn their variable to true (or we can say if all player turn on their gens) and i dont want that, i want when a single player turn on their gen the gen will work and only give it to the player, sorry for my bad english and explaination, if u need more info u can ask
i hope someone can help me with this, its so confusing for me, thank you
Code:
on right click:
if player is holding a music disc strad named "&fIron &7Generator" with lore "{@ironl}" and "&7Status: &cOff":
if {gensiron.%player%} is false:
set {gensiron.%player%} to true
set line 2 of lore of player's tool to "&7Status: &aOn"
send "{@p} {@on}"
if {gensiron.%player%} is true:
if player is online:
while player has music disc stard:
give player 1 iron block
wait 4 seconds
else if player is not online:
stop
else if {gensiron.%player%} is true:
send "{@p} {@only1}"
else if player is holding a music disc strad named "&fIron &7Generator" with lore "{@ironl}" and "&7Status: &aOn":
send "{@p} {@alreadyon}"
on left click:
if player is holding a music disc strad named "&fIron &7Generator" with lore "{@ironl}" and "&7Status: &aOn":
set {gensiron.%player%} to false
set line 2 of lore of player's tool to "&7Status: &cOff"
send "{@p} {@off}"
else if player is holding a music disc strad named "&fIron &7Generator" with lore "{@ironl}" and "&7Status: &cOff":
send "{@p} {@alreadyoff}"
set {gensiron.%player%} to false
every 4 seconds:
loop all players:
if {gensiron.%loop-player%} is true:
if loop-player is online:
if loop-player has music disc strad:
give loop-player 1 iron Block
else if loop-player is not online:
stop
else if {gensiron.%loop-player%} is false:
stop
on drop of music disc strad:
cancel event
send "{@p} {@drop} to player"
i hope someone can help me with this, its so confusing for me, thank you