Solved adding a wait in a loop

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

MixedNoob

Member
Apr 10, 2020
10
1
3
Code:
command /test7:
   trigger:
      loop all players:
         if {E::*} contains loop-player:
            send "Test1" to loop-player
            halt 10 seconds
            send "Test2" to loop-player

Im not sure how to explain this really..
The loop only executes one at a time Test "1" will send to ALL players but then since there is a wait in the script instead of sending "Test2" to all players it only sends it to one player AT A TIME for some reason but when I remove the wait in the script it sends "Test1" and "Test2" to all players i want the wait to wait for all players not just one
 
I see no error on it but ok

try
Code:
command /test:
    trigger:
        if (size of {E::*}) >= 1:
            loop {E::*}:
                send "message1" to loop-value
                wait 10 seconds
                send "message2" to loop-value
 
still doesn't work there are no errors in the code the problem is the wait only works for one player at a time I want the wait to work for ALL PLAYERS
 
Try:


Code:
command /test7:
  trigger:
    msgPlayers(players)

function msgPlayers(ps: players, txt: text = "Test1", txt2 text = "Test2", waitTime: integer = 10):
  message {_txt} to {_ps::1}
  wait {_waitTime} seconds
  message {_txt2} to {_ps::1}
  {_ps::*} = {_ps::*} - {_ps::1}
  if {_ps::*} is set:
    msgPlayers({_ps::*}, {_txt}, {_txt2}, {_waitTime})

Sorry if I made any mistakes I haven't been using Skript for a while.
 
Status
Not open for further replies.