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

Npc attacking animation wont work u can fix this?

its wont working

function onTouched(hit)
damage = 5
human.Health = human.Health - damage
script.Parent.Human:LoadAnimation(script.Parent.Slash):Play()
end

script.Parent.Touched:connect(onTouched)

Human = Humanoid but its enemy

1 answer

✓ Accepted answer
function onTouched(hit)
	damage = 5
	human.Health = human.Health - damage
	local track = script.Parent.Human:LoadAnimation(script.Parent.Slash):Play() -- means you loaded it in
	track:Play() -- must play the track
end

script.Parent.Touched:Connect(onTouched) -- always uppercase the connect it's preferred for signals

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