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

  2. LOOKING FOR A VERSION OF SKRIPT??:

    You can always check our our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Loop all player how i do plz help?

Discussion in 'Skript' started by Moustachaus, Feb 21, 2018.

Thread Status:
Not open for further replies.
  1. Moustachaus

    Moustachaus Member

    Joined:
    Feb 21, 2018
    Messages:
    1
    Likes Received:
    0
    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
    --- Double Post Merged, Feb 21, 2018, Original Post Date: Feb 21, 2018 ---
    Oh its ok!
     
  2. Wynnevir

    Wynnevir Well-Known Member

    Joined:
    Jul 9, 2017
    Messages:
    974
    Likes Received:
    57
    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.
     
Thread Status:
Not open for further replies.
Loading...