hey guys, I want your suggestions for what to do in my round-based system. What I want to achieve is a round-based system bomb that explodes in x amount of seconds. After the bomb explodes the repeat loop will start again and give the bomb to another player if players are not 1. the problem is for example if one player leaves it to wait until the bomb explodes to check again.
I removed parts of the script that are not useful to the solution afaik. I also have a characterremoving event that removed the player from the playing and if he was the bomber it would pick another random player if there are enough players but if not it would just destroy the bomber value.
repeat
local Bombs = colService:GetTagged('Bomb')
local Timer = 30
local function TickSecond()
local start = tick()
repeat
runService.Heartbeat:Wait()
until tick() - start >= 1
end
repeat
CountVal.Value = Timer
TickSecond()
Timer -= 1
until Timer <= 0
for i,Bomber in pairs(Bombers:GetChildren()) do
for i,v in pairs(Playing) do
if v == Players:GetPlayerFromCharacter(Bomber.Value) then
table.remove(Playing,i)
end
end
Bomber:Destroy();
end
until #Playing < 1