can someone teach me how to make an touchpad that someone will touch it and the animation will run on the npc
COMMUNITY QUESTION
How to Make a Touchpad that will make the animation run?
1 answer
If you have a part in workspace called TouchPad and your NPC has a humanoid, this should work in a script inside the NPC:
local anim = Instance.new("Animation")
anim.AnimationId = ""--enter id inside quotes
workspace.TouchPad.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local track = script.Parent.Humanoid:LoadAnimation(anim)
track.Priority = Enum.AnimationPriority.Action
track:Play()
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.
