Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How would I make this script loop, and why isn't the kill function working?

This script will run once, but the kill function

end
end
for i, player in pairs(game.Players:GetPlayers()) do
player:BreakJoints()
end
end

Won't work. How would I make the whole script loop, and what's the error with the kill function?

time=0
while true do
wait()
time=time+30
for i=1, 30 do
    time=time-1
    wait(1)
    for i, player in pairs(game.Players:GetPlayers()) do
    player.PlayerGui.TimerSet.Frame.Time.Text=tostring(time) 
end
end

time=time+45
for i=1, 45 do
    time=time-1
    wait(1)
    for i, player in pairs(game.Players:GetPlayers()) do
    player.PlayerGui.TimerSet.Frame.Time.Text=tostring(time)
end
end
for i, player in pairs(game.Players:GetPlayers()) do
player:BreakJoints()
end
end

Whole script Thanks!

2 answers

✓ Accepted answer
for i, player in pairs(game.Players:GetPlayers()) do
player.Character.Humanoid.Health = 0
player.Character.Humanoid.MaxHealth = 0
end

ABOVE Should fix the killing error.

while true do -- Correct way of the loop
-- Insert code here.
wait() -- You can make the time before the next round starts, Intermission
end

4 comments

0

What do you mean by "-- Insert code here"?

0

Insert the code you have.

0

What code exactly?....

0

Why did you change the maxhealth to 0? BreakJoints would do it.

You can't break joints of a Player, but of its character. Just change to this:

for i, player in pairs(game.Players:GetPlayers()) do
	player.Character:BreakJoints()
end

1 comment

0

Ohh. Thanks!

This discussion is preserved as it was. New answers, comments, and votes are closed.