It works on local server 2 players, when I equip a tool the equip animation plays and pauses (so a pose is achieved on equip) and stops on unequip (goes back to normal position). It works on local server testing but not on actual game... The script:
wait(3) local tool = script.Parent -- use local variables local Player = game.Players.LocalPlayer --get the local player local isitEquipped = Player.hasWeapon local getName = Player.Name local attack = workspace:FindFirstChild(getName).Humanoid:LoadAnimation(script.equipAnimation) tool.Equipped:Connect(function(mouse) -- :Connect not :connect, :connect is deprecated isitEquipped.Value = true attack:Play() wait(attack.Length - 0.1) attack:AdjustSpeed(0) end) tool.Unequipped:Connect(function() isitEquipped.Value = false local idle = workspace:FindFirstChild(getName).Humanoid:LoadAnimation(script.Idle) attack:AdjustSpeed(1) wait(0.1) attack:Stop() end)
okay :connect isnt deprecated but make it a local script and put it in StarterPlayer,StarterCharacterScripts also make sure whenever u call Player and its referring to local player always do
if Player ~= nil then --code here end
or else the console will say your attempting to call a nil value and disable your script