there's tool that plays an animation but when the player moves the animation stops
this is a local script inside of a tool
enabled = false
local Tool = script.Parent;
local dancer = nil
function onActivated()
if enabled == false then
local humanoid = Tool.Parent:FindFirstChild("Humanoid")
dancer = humanoid:LoadAnimation(Tool.dance)
Tool.DanceObject.Value = dancer
dancer:Play()
enabled = true
repeat
wait(1)
until enabled == false
else
dancer:Stop()
dancer:remove()
enabled = false
end
end
function onUnequipped()
dancer:Stop()
dancer:remove()
enabled = false
end
Tool.Activated:connect(onActivated)
Tool.Unequipped:connect(onUnequipped)
help
