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

how can i make this for loop repeat if a player dies?

Asked by 6 years ago

This is the loop i want to repeat on a players death:

wait(1)
for i = 0,10,1 do
    Lava.Size = Vector3.new(380.5,0.5+i,2318)
    wait(.2)
end

2 answers

Log in to vote
0
Answered by
xdeno 187
6 years ago

Try using this function and add your loop to it

game:GetService('Players').PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function(character)
        character:WaitForChild("Humanoid").Died:connect(function()
            print(player.Name .. " has died!")
        end)
    end)
end)
0
where do I add the loop? Prbo1201 56 — 6y
0
Where the print is. MooMooThalahlah 421 — 6y
Ad
Log in to vote
0
Answered by
wookey12 174
6 years ago
Edited 6 years ago

game.Players.PlayerAdded:connect(function(plr) for i = 0,10,1 do Lava.Size = Vector3.new(380.5,0.5+i,2318) wait(.2) end end)

0
does this make the loop start from the beginning? Prbo1201 56 — 6y
0
it runs the loop when the player dies wookey12 174 — 6y
0
how do I make it run first and then it runs again if a player dies Prbo1201 56 — 6y
0
oh! let me edit it wookey12 174 — 6y
0
parent it inside of starterpack. put it in a normal script wookey12 174 — 6y

Answer this question