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

Sword idle animation won't stop playing?

Asked by 5 years ago
Edited 5 years ago

So when a player dies with the tool equipped, and they respawn, then equip the tool then unequip it, the idle anim is still playing.

01local plr = game.Players.LocalPlayer
02local char = plr.Character or plr.CharacterAdded:wait()
03local tool = script.Parent
04local swingsound = tool:WaitForChild("Swing")
05local canattack = tool:WaitForChild("CanAttack")
06 
07local debounce = false
08local delayForDebounce = .5
09 
10tool.Equipped:Connect(function()
11    local Equip = script.Parent.Parent.Humanoid:LoadAnimation(script.Sword)
12    Equip:Play()
13    wait(1.5)
14    local idle = script.Parent.Parent.Humanoid:LoadAnimation(script.Idle)
15    idle:Play()
View all 56 lines...
0
did you try the variouble? ik i spelt it wrong 3wdo 198 — 5y
0
Wdym? Justingamer700 114 — 5y
0
oh i just looked at the title im dumb let me fix it 3wdo 198 — 5y
0
i thought you were saying it wont start playing 3wdo 198 — 5y
View all comments (2 more)
0
CRAP 3wdo 198 — 5y
0
I FORGOT TO PUT IT IN LUA 3wdo 198 — 5y

1 answer

Log in to vote
1
Answered by
3wdo 198
5 years ago
Edited 5 years ago
01local plr = game.Players.LocalPlayer
02local char = plr.Character or plr.CharacterAdded:wait()
03local tool = script.Parent
04local swingsound = tool:WaitForChild("Swing")
05local canattack = tool:WaitForChild("CanAttack")
06 
07local debounce = false
08local delayForDebounce = .5
09 
10tool.Equipped:Connect(function()
11    local Equip = script.Parent.Parent.Humanoid:LoadAnimation(script.Sword)
12    Equip:Play()
13    wait(1.5)
14    local idle = script.Parent.Parent.Humanoid:LoadAnimation(script.Idle)
15    idle:Play()
View all 54 lines...
Ad

Answer this question