Loop all player how i do plz help?

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Moustachaus

Member
Feb 21, 2018
1
0
0
26
This is my code:


every 1 second:
if {cocaine.activate} is true:
loop all players:
if loop-player is not within {zone1} to {zone2}:
wait 2 ticks
add {cocaine.item} named "&eCocaine" to loop-player's inventory
message "&eUne cocaine reçue." to loop-player
stop
else:
stop

Its so glitchy, when a player go in the zone, he can have the cocaine but no one else can. But when i kill the player, another player can go recolt ! Thx
[doublepost=1519252220,1519243665][/doublepost]Oh its ok!
 
It's okay as in you solved your issue? If so, mark the post as solved.^-^

Though looping all your players every second is rather laggy. You could give them the item on exit of the zones or use a while loop.
 
Status
Not open for further replies.