I have been trying to use the countdown clock gui that roblox gives out for their capture the flag game, and attempted to make the script kill all humanoids at the end of the countdown: (0:00). Could someone please help me find out how to put the two scripts together correctly, or help me make a new one? If you could, that woul be great, thanks!
COMMUNITY QUESTION
What do I need in a script that kills all humanoids after 5:00, and is on a continuous loop?
1 answer
local minutes = 5 -- What the timer starts from
local seconds = 00 -- What the timer starts from
local min = minutes
local sec = seconds
function killPlayers()
local a = game.Players:GetChildren()
for _,v in pairs (a) do
v.Character:BreakJoints() -- Kills the player
end
end
while true do
wait(1)
sec = sec - 1
if sec == 0 then
min = min - 1
if min == 0 then
killPlayers()
min = minutes
sec = seconds
else
sec = 59
end
end
local count = min.. ":" ..sec
Gui.Text = count
end
That should work. Do you need me to explain it for you, or do you have it?
3 comments
0
Simply giving code does not enlighten the Asker with a broader concept of understanding.
0
He may already know these things, but didn't know how to use them for his purpose. Comment, then I will edit.
0
Read before you post and downvote.
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Provide the code, please.
Show us your code.