Hello, I have another question on something I am confused on.
I’m looking to make rounds for a musical chairs game using a while loop, but I am using bindable events to grab other script’s code inside the while loop. When I play the game, there is no wait period in between each bindable function being called. I’m confused because I don’t see how I can fix AND I can’t add waits because I need to wait for the entire code in each event to finish!!!
Here is what one of the functions in the while loop are like: (All of them are the same pretty much, just calling different bindable events)
function WaitForPlayers()
Events.WaitForPlayers:Fire(Players, Status, Teams, Remotes, GameSpawn, DefaultMusicIds, CustomMusicIds, SeatedPlrs, playersInGame, Stage)
end
Here is the while loop:
local Active = false
function StartRoutine()
WaitForPlayers()
BeginIntermission()
SetupTeams()
TPandSetChairs()
StartRnd()
FindASeat()
Active = false
end
while true do
if Active == false then
Active = true
StartRoutine()
end
wait(0.5)
end
All I really need to know is if there is some way to pause the loop until an event finishes? Thanks for any help.