Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How can I make the IdleAnimation run with my tool equipped?

After the EquipAnimation is over, the arm holding the tool goes back to holding the tool the default way instead of running my Idle script, but the other arm is affected by the animation. Any way I can make the animation run on both arms even though the tool is equipped? (Yes, I have made the animation work for both arms)

function equippistol()
	humanoid = tool.Parent:FindFirstChild("Humanoid")
	if humanoid then
		local anim = tool:FindFirstChild("IdleAnim")
		if anim and humanoid then
			if loadedidleanim then
				loadedidleanim:Stop()
			end
			loadedidleanim = humanoid:LoadAnimation(anim)
			if loadedidleanim then
				loadedidleanim:Play()
			end
		end
		local anim = tool:FindFirstChild("EquipAnim")
		if anim and humanoid then
			local loadedanim = humanoid:LoadAnimation(anim)
			if loadedanim then
				loadedanim:Play()
			end
		end
	end
end

function unequippistol()
	if loadedidleanim then
		loadedidleanim:Stop()
	end
	local anim = tool:WaitForChild("UnEquipAnim")
	if  humanoid and anim then
		local loadedanim = humanoid:LoadAnimation(anim)
		if loadedanim then
			loadedanim:Play()
		end
	end
end

Thank you for any help!

1 answer

✓ Accepted answer

Equipped arm is on right arm, check it, the left arm is probably affected, so you should change idleanim and remove left arm's animation, and make sure the pistol tool has IdleAnim of your Anim ID.

This discussion is preserved as it was. New answers, comments, and votes are closed.