local rp = game:GetService("ReplicatedStorage")
local players = game:GetService("Players")
local startedPlayer = game:GetService("StarterPlayer")
local starterCharacter = startedPlayer:WaitForChild("StarterCharacterScripts")
local player = players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local tool = script.Parent
local equipped = false
local event = rp:WaitForChild("Combat")
local Animations = rp:WaitForChild("Animations")
local combatIdle = humanoid:LoadAnimation(Animations:WaitForChild("CombatIdle"))
local idle = humanoid:LoadAnimation(starterCharacter.Animate.idle:WaitForChild("Animation1"))
print(idle)
local data = game.Players.LocalPlayer:WaitForChild("Data")
local inCombat = data.InCombat
inCombat.Value = false
tool.RequiresHandle = false
script.Parent.Equipped:Connect(function()
equipped = true
print(equipped)
combatIdle:Play()
inCombat.Value = true
end)
script.Parent.Unequipped:Connect(function()
equipped = false
print(equipped)
combatIdle:Stop()
inCombat.Value = false
end)
Okay, so I have a script that turns on combatIdle when you take a tool in your hand, but the usual idle animation that I replaced with mine in the script animate, does not stop. I tried stopping it with my combat script, but it doesn’t stop either, so I end up with two animations when I hold the item in my hands. In output no errors.