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

How do i make it so when my character dies it triggers a cutscene?

Asked by 5 years ago

How do i make it so when my character dies it triggers a cutscene ? im using cutscene editor plugin. i want to make it so when the player dies it triggers a cutscene.

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

This will trigger right before the character respawns

game.Players.PlayerAdded:Connect(function(plr)
    plr.CharacterRemoving:Connect(function(char)
        print(plr.Name.." died!")
        --Script here
    end)
end)

Otherwise, if you want the cutscene to trigger as your humanoid dies (as you go oof)

game.Players.PlayerAdded:Connect(function(plr)
    repeat wait() until plr.Character~=nil
    plr.Character:WaitForChild("Humanoid").Died:Connect(function()
        print(plr.Name.." died!")
        --Script here
    end)
end)

You can remove the print(plr.Name.." died!"). I hope this helped!

Ad

Answer this question