Script:

local plr = game:GetService("Players").LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local h = char:WaitForChild("Humanoid")
local anim = h:LoadAnimation(script.Parent:WaitForChild("IdleAnim"))
local sound1 = script.Parent.LSound1
local sound2 = script.Parent.LSound2	

local tool = script.Parent

tool.Equipped:Connect(function()
 anim:Play()
 sound1:Play()
end)

tool.Unequipped:Connect(function()
 anim:Stop()
 sound2:Play()
end)

3 comments

0

Have a function for when the Player dies. Hook a function to the player's Humanoid.Died function and then reload the animation into the humanoid after the player has respawned.

0

Forgot to mention something. In that function you need to wait until the players character has loaded in, so use plr.CharacterAdded:Wait() somewhere.

0

Fixed it already