Tool animation not working

local Players = game:GetService("Players")
local Replicated = game:GetService("ReplicatedStorage")

local CEvents = script.Parent:WaitForChild("Info")
local SEvents = Replicated:WaitForChild("Events")

local Player = Players.LocalPlayer
local Char = Player.Character or Player.CharacterAdded:Wait()

local Tool = script.Parent

local Animations = Tool.Animations

local IdleAnim = Char.Humanoid:LoadAnimation(Animations.Idle)
IdleAnim.Priority = Enum.AnimationPriority.Idle

local Mouse = Player:GetMouse()

local Equipped = false

Tool.Equipped:Connect(function()	
	Equipped = true
	
	Replicated.Events.M6D.Connection:FireServer(Tool.BodyAttach)
	
	Char.Torso:WaitForChild("ToolGrip").Part0 = Char.Torso
	Char.Torso:WaitForChild("ToolGrip").Part1 = Tool.BodyAttach
	
	IdleAnim:Play()
end)

Tool.Unequipped:Connect(function()
	Replicated.Events.M6D.Disconnect:FireServer()
	
	IdleAnim:Stop()
end)

Mouse.Button1Down:Connect(function()
	if Equipped then
		CEvents.Fired:FireServer(Mouse.Hit.p)
		
		Tool.Sounds.Fired:Play()
	end
end)```

i have this and when i equip it the animation doesnt play and the gun goes inside the players torso

Judging by the code, you followed a tutorial by HeadStackk? The only thing I believe it could be is that you must’ve done a step incorrectly or set the id of the Idle Animation wrong

i made the animations from howtoroblox’s youtube and the id is correct

Do you own the animation? If you dont own it it will not play

yes i do own it⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀

Where did you learn about the code you are using for ToolGrips and what not? Were you using HeadStackk’s Tool animation guide for part of it?

Check if the Tool.Equipped event is firing by putting a print statement in their

yeah i have already it seems to be firing

Maybe take out the part where you set its priority

1 Like

Most likely then a step was done incorrectly? If you’re saying the id is correct and it is equipping then it has to be an incorrect step. May try following along Headstackk’s Devforum post?

1 Like

just found out the issue, in the animation editor i didnt select the dummy parts when exporting, thank you anyway :slight_smile:

1 Like

I see, at least in the end the issue was discovered! If you have anymore issues don’t be afraid to make another post!

1 Like