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

Why this script is not working? it's not playing the animation

Asked by 5 years ago

the npc was supposed to damage the player and play an animation, but is not playing the animation

Hum = script.Parent.Parent.Humanoid function onTouch(part) local humanoid = part.Parent:FindFirstChild("Humanoid") if (humanoid ~= nil) then -- if a humanoid exists, then humanoid.Health = humanoid.Health - 1 -- damage the humanoid script.Parent.Parent.Humanoid:LoadAnimation(Hum.Anim) end end

script.Parent.Touched:connect(onTouch)

1
Please use the code block. For starters you loaded the animation but never played it. ABK2017 406 — 5y
0
PLEASE USE CODE BLOCK I CAN"T SEE RetroGalacticGamer 331 — 5y
0
USE CODE BLOCK!!!! nbkdn 2 — 5y

Answer this question