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

Is It possible to disable the default idle animation?

Asked by 3 years ago

I was wounder if it is possible to disable the default idle animation when a tool is equipped, then enabling it when the tool is unequipped, because i have my own idle animation but the default still plays. I've tried many things, like changing the id to nothing when equipped and putting the default id back, but noting seems to work.

0
Change the Animation Priority to Action. LazokkYT 117 — 3y
0
add an animation to the tool thats idle and in the script in the tool script it to play the animation when you hold it Sabertooth11123 38 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

It is easy. Simply use the Humanoid:LoadAnimation() function.

local tool = script.Parent
local plr

tool.Equipped:Connect(function()
if plr == nil then
plr =game.Players:GetPlayerFromCharacter( tool.Parent)
end
local anim = Instance.new("Animation") -- If you already have an animation, type the directory here
anim.AnimationId = "rbxassetid://youridhere" -- Edit, i forgot to add it in
local loadedAnim = plr.Character.Humanoid:LoadAnimation(anim)
anim.Looped = true
anim:Play()
tool.Unequipped:Connect(function()
anim:Stop()
end)
end)



Ad

Answer this question