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

how to make part that animate npc?

Asked by 2 years ago

how to make part that animate npc? not player

1 answer

Log in to vote
0
Answered by 2 years ago
local target = script.Parent -- Change this to point to the part you want to trigger the event

target.Touched:Connect(function() -- When the player touches the part
    local dummy = workspace.Dummy -- Refer to the NPC, Change this to point to the NPC
    local animator = dummy.Humanoid.Animator -- Refer to the animator
    local animation = animator:LoadAnimation() -- Loads the animation, Insert a Animation ID into LoadAnimation()
    animation:Play() -- Play the animation
end)

Insert it into a Script on a Part.

Ad

Answer this question