Tool idle animation

Anyone know how to make a script of an idle animation that only plays if ur tool is equipped and ur current speed is 0 so it’s an idle animation and if u move the animation stops cuz all the videos I seen do idle animation they still play even if ur moving so it’s not really an idle animation

1 Like

change the idle animation of the character’s animator when it is equipped, then change it back when unequip

Use one of those youtuber’s idle scripts and do this

Tell me if it works

(replace the idle animation ID with your anim)

  1. It never included a check to see if the tool is equipped
  2. You are playing the idle animation when the player is moving, and stopping it when the player is idle?

Oops. Just some silly mistakes on my end haha. As said - not playtested.

1 Like

With the model you gave me do I just spawn a dummy and animate it then export it into ur thing

Animation plays it just when I in un equip it still plays animation

this wat i do for my game

Tool.Equipped:Connect(function()
	equipped = true

	ChangeDamageValue:FireServer(Tool.Name)

	Idleanimtrack:Play()
end)

Tool.Unequipped:Connect(function()
	equipped = false

	Idleanimtrack:Stop()
	Walkanimtrack:Stop()
	ResetDamageValue:FireServer(Tool.Name)
end)

character.Humanoid.Running:Connect(function(speed)
	if equipped == true then
		if speed > 0 then
			Idleanimtrack:Stop()
			Walkanimtrack:Play()
		elseif speed == 0 then 
			Idleanimtrack:Play()
			Walkanimtrack:Stop()
		end
	end
end)

A lot of red underlined and don’t know what chance damage value is…

It Dident work the animation only plays once ur character moves so not really idle until someone moves

new script

local BRUHMOMENT = false
local humanoidObject = nil
local idleTrack = nil

local z = nil

script.Parent.Equipped:Connect(function()
	BRUHMOMENT = true
	humanoidObject = script.Parent.Parent.Humanoid
	idleTrack = humanoidObject:LoadAnimation(script.Parent.idle)
	if humanoidObject and idleTrack then
		z = humanoidObject.Running:Connect(function(d)
			if not BRUHMOMENT then return end
			if d > 0 then
				idleTrack:Stop()
				return
			end
			idleTrack:Play()
		end)
		idleTrack:Play()
	end
end)

script.Parent.Unequipped:Connect(function()
	BRUHMOMENT = false
	if z then
		z:disconnect()
	end
end)

It works but when u run with it out it still plays kinda my hand goes weird while running with it out but better than last script

Also I changed the z:disconnect cuz it Dident work to idletrack:Stop and it works when I unequip

Yea only problem is that animation still plays if I pull it out while running or idle then run

Why dod you remove the disconnect then lol

Was disconnect supposed to make animation stop cuz it didn’t

It makes the event stop running

local BRUHMOMENT = false
local humanoidObject = nil
local idleTrack = nil

local z = nil

script.Parent.Equipped:Connect(function()
	BRUHMOMENT = true
	humanoidObject = script.Parent.Parent.Humanoid
	idleTrack = humanoidObject:LoadAnimation(script.Parent.idle)
	if humanoidObject and idleTrack then
		z = humanoidObject.Running:Connect(function(d)
			if not BRUHMOMENT then return end
			if d > 0 then
				idleTrack:Stop()
				return
			end
			idleTrack:Play()
		end)
		idleTrack:Play()
	end
end)

script.Parent.Unequipped:Connect(function()
	BRUHMOMENT = false
	if z then
		z:disconnect()
	end
	if idleTrack then
		idleTrack:Stop()
	end
end)

I added it back but I also added the :stop under the equipped cuz it makes the animation stop running

If u pull out the weapon while running it the idle animation still plays