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

MY Humanoid action Event is Working outside of my EQuip event please help?

Asked by 3 years ago

can somebody tell me why my humanoid action event is running outside of my equip event?


local Idle = script:WaitForChild("KatanaIdle") local other = script:WaitForChild("KatanaOther") local idleAnim = Humanoid:LoadAnimation(Idle) local otherAnim = Humanoid:LoadAnimation(other) tool.Equipped:Connect(function() Humanoid.Running:Connect(function(speed) if speed > 0 then for i, v in pairs(Humanoid:GetPlayingAnimationTracks()) do if v.Name == "KatanaIdle" then v:Stop() end end otherAnim:Play() else for i, v in pairs(Humanoid:GetPlayingAnimationTracks()) do if v.Name == "KatanaOther" then v:Stop() end end idleAnim:Play() end end) end) tool.Unequipped:Connect(function() for i, v in pairs(Humanoid:GetPlayingAnimationTracks()) do if v.Name == "KatanaIdle" or v.Name == "KatanaOther" then v:Stop() end end end)

Answer this question