here is script
local trackanimation = nil
script.Parent.Activated:Connect(function() trackanimation = script.Parent.Parent.Humanoid:LoadAnimation(script.Parent.Move) trackanimation:Play()
end)
here is script
local trackanimation = nil
script.Parent.Activated:Connect(function() trackanimation = script.Parent.Parent.Humanoid:LoadAnimation(script.Parent.Move) trackanimation:Play()
end)
All you would really need to do here is create an unequipped event and stop your animation within it. Good luck with the game you are making! (please put your code in code blocks next time)
here is the source code without the unequipped event added:
local trackanimation = nil
script.Parent.Activated:Connect(function()
trackanimation = script.Parent.Parent.Humanoid:LoadAnimation(script.Parent.Move)
trackanimation:Play()
end)
script.Parent.Unequipped:Connect(function()
trackanimation:Stop()
end)
https://developer.roblox.com/en-us/api-reference/event/Tool/Unequipped this is the dev hub page if you need another reference
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Use code block.