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

Why my character doesn't respawn?

Asked by 4 years ago
Edited 4 years ago

i put death animation to the game character and doesn't respawn (sorry for my bad english)

script.Parent.dechanimeichion.OnServerEvent:Connect(function(_, anim, humanoid, char, root)
    humanoid:LoadAnimation(anim):Play()
    root.Anchored = true
end)
--anim = the death animation
--humanoid = the humanoid from the character
--char = the character
--root = HumanoidRootPart from the character

https://www.youtube.com/watch?v=CtltNSmxwqI

0
Add the LoadCharacter() as that person's answer said, but also play the animation in the LocalScript. Animations meant for players should be played by a LocalScript while animations for NPCs should be played by a normal script. Warfaresh0t 414 — 4y

1 answer

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

You have to use :LoadCharacter() wich can respawn the player, this is a method from Player object, also to make good questions make them more descriptive.


script.Parent.dechanimeichion.OnServerEvent:Connect(function(plr, anim, humanoid, char, root) humanoid:LoadAnimation(anim):Play() local animationTrack = humanoid:LoadAnimation(anim) -- Get the animation Track local Delay= animationTrack.Length -- get the length root.Anchored = true wait(Delay) -- wait the animation to be completed plr:LoadCharacter() end)

Mark this as answered if this answered your question!

Ad

Answer this question