Hello, so I was making a zombie game. And I got a issue animation that plays when zombie grabs player doesnt stop after playing it.
(This is my first post)
I tried boolean, debugging, Checking if animation plays (IsPlaying) and it still doesnt work.
Im confused why it doesnt work, please help.
Code:
script.Parent:WaitForChild("IsBittedByRunner").Changed:Connect(function()
if script.Parent:WaitForChild("IsBittedByRunner").Value == true then
animgrabbed = script.Parent:FindFirstChildOfClass("Humanoid"):LoadAnimation(script.Parent.RunnerGrabbed)
animgrabbed.Priority = Enum.AnimationPriority.Action2
animgrabbed:Play()
elseif script.Parent:WaitForChild("IsBittedByRunner").Value == false then
if animgrabbed.IsPlaying == true then
animgrabbed:Stop()
end
end
end
end)
(Also animation script type is serverscript)