local Death = script.DeathAnimations
local plr = game.Players.LocalPlayer or game.Players.PlayerAdded:Wait()
local char = plr.Character or plr.CharacterAdded:Wait()
local hum = char:WaitForChild("Humanoid")
hum.BreakJointsOnDeath = false
plr.CharacterAdded:connect(function(char)
char:WaitForChild("Humanoid"):SetStateEnabled(Enum.HumanoidStateType.Dead, false)
end)
hum.Died:Connect(function()
game.StarterGui:SetCoreGuiEnabled("Backpack", false)
char.HumanoidRootPart.Anchored = true
hum:UnequipTools()
script.Parent.RemoteEvent:FireServer()
local DeathAnimation = hum:LoadAnimation(Death)
DeathAnimation:Play()
wait(10)
char.HumanoidRootPart.Anchored = false
script.Parent.RemoteEvent2:FireServer()
game.StarterGui:SetCoreGuiEnabled("Backpack", true)
end)
COMMUNITY QUESTION
How do I make it where if a player dies, they can move after 10 seconds is over?
1 answer
You can use the 'PlayerModule' that is built in to disable and enable movement.
local Movement = require(game.Players.LocalPlayer.PlayerScripts.PlayerModule):GetControls()
local Death = script.DeathAnimations
local plr = game.Players.LocalPlayer or game.Players.PlayerAdded:Wait()
local char = plr.Character or plr.CharacterAdded:Wait()
local hum = char:WaitForChild("Humanoid")
hum.BreakJointsOnDeath = false
plr.CharacterAdded:connect(function(char)
char:WaitForChild("Humanoid"):SetStateEnabled(Enum.HumanoidStateType.Dead, false)
end)
hum.Died:Connect(function()
game.StarterGui:SetCoreGuiEnabled("Backpack", false)
char.HumanoidRootPart.Anchored = true
hum:UnequipTools()
script.Parent.RemoteEvent:FireServer()
local DeathAnimation = hum:LoadAnimation(Death)
DeathAnimation:Play()
Movement:Disable()
wait(10)
Movement:Enable()
char.HumanoidRootPart.Anchored = false
script.Parent.RemoteEvent2:FireServer()
game.StarterGui:SetCoreGuiEnabled("Backpack", true)
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Still not able to move. Not sure what I'm doing wrong.