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

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

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

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!

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