So I have a localscript inside a tool and basically whenever you click with the tool equipped its supposed to fire a remote event and run an animation while having a value = false. The tool works fine without the if Tool.Handle.Cooldown == false then but I want it to make the code run if Cooldown = false and not make it run if Cooldown = true. Im a bit of a noob at scripting so if its obvious I probably wont know
local plr = game.Players.LocalPlayer
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Attack = ReplicatedStorage:WaitForChild("OnAttackSword")
local char = plr.Character
local Tool = script.Parent
Tool.Activated:Connect(function()
if Tool.Handle.Cooldown == false then -- this line breaks the entire script
print("Stone Sword was Activated")
game.ReplicatedStorage:FindFirstChild("OnAttackSword"):FireServer(char)
local animation = plr.Character.Humanoid:LoadAnimation(script.Parent.Attack1)
animation:Play()
end
end)
And yes, I checked if the value was false before running it

1 comment
What is Tool.Handle.Cooldown? Is it a Value? If so, try Tool.Handle.Cooldown.Value