This is the code in one of my scripts, it's meant to call a Bindable Event every certain amount of time. But I noticed that the second wait doesn't run for some reason. And then when I delete the "wait(65)" the other wait does run.
Is this simply something I can't do? Am I not allowed to have multiple while waits in a single script?
local start = tick()
local function updateQuests(t)
game.ReplicatedStorage.DCQuestsUpdate:Fire()
end
local function updateDailyRewards(t)
print("DAILY REWARDS UPDATE DAILY RAN")
game.ReplicatedStorage.DailyRewardsUpdate:Fire()
end
while wait(65) do
updateQuests(tick()-start)
end
while wait(10) do
print("DAILY REWARD RAN")
updateDailyRewards(tick()-start)
end

4 comments
because the first while loop never breaks, thus the code never gets to the second loop
I guess I should put each in their own script. Thanks
You don't necessarily need to put them in separate scripts, just multithread with spawn() or coroutines.
I would advise against using while wait() do, but, in the end, it's your choice.