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

Tool idle and walk animations not playing?

Asked by 5 years ago

I have a sword tool that contains two scripts, one named "swordAnimations" and the other "whenEquipped". Currently, I'm trying to have a tool idle animation play when standing still and a tool walk animation to play when the latter happens, but the default ROBLOX animations still play. The "whenEquipped" script is working fine, but the "swordAnimations" script is what I'm concerned with.

There are currently no errors in the output bar when testing this.

"swordAnimations" script:

01---VARIABLES---
02 
03character = script.Parent.Parent
04humanoid = script.Parent.Parent:FindFirstChild("Humanoid")
05 
06sword_idle = humanoid:LoadAnimation(script.sword_idle)
07sword_walk = humanoid:LoadAnimation(script.sword_walk)
08 
09---FUNCTIONS---
10 
11local function swordAnimations()
12        local state = humanoid:GetState()
13        if character.Torso.Velocity < 5 then --If player is standing still
14        local ActiveTracks = humanoid:GetPlayingAnimationTracks()
15        for _,v in pairs(ActiveTracks) do --Stop all playing animations
View all 33 lines...

"whenEquipped" script:

01---VARIABLES---
02 
03animationsPlaying = script.Parent.swordAnimations
04 
05---FUNCTIONS---
06 
07animationsPlaying.Disabled = true
08 
09local function onEquip()
10    animationsPlaying.Disabled = false
11    print("equipped")
12end
13 
14local function onUnequip()
15    animationsPlaying.Disabled = true
View all 22 lines...

Any help or inquiries would be greatly appreciated!

Answer this question