Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 10 years ago

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

Log in to vote
1
Answered by
HexC3D 830 Moderation Voter
10 years ago
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

0
What do you mean by "-- Insert code here"? nightmare13542 45 — 10y
0
Insert the code you have. HexC3D 830 — 10y
0
What code exactly?.... nightmare13542 45 — 10y
0
Why did you change the maxhealth to 0? BreakJoints would do it. Tesouro 407 — 10y
Ad
Log in to vote
0
Answered by
Tesouro 407 Moderation Voter
10 years ago

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
0
Ohh. Thanks! nightmare13542 45 — 10y

Answer this question