Hi guys! I have been trying to make it for a while now, I want to make NPC, that could move with animation I did.
I have found only when you can press on the NPC, and the animation plays. But I would like it always to play without clicking on it!
Here is the script I used for the click play animation.
local NPC = script.Parent.Parent.Parent
local Plays = false
local humanoid = NPC:WaitForChild(“Humanoid”)
local Anim = Instance.new(“Animation”)
Anim.AnimationId = “rbxassetid://6161519819”
local AnimPlay = humanoid:LoadAnimation(Anim)
script.Parent.MouseClick:Connect(function()
if Plays == false then
AnimPlay:Play()
Plays = true
else
Plays = false
AnimPlay:Stop()
end
end)
Thank you!