Alright, so what this script is supposed to do is you activate it and it stays for 10 seconds, then after 10 seconds it deactivates and has a wait time of 45 to use it again whilst naming itself cooldown. But this isn't working, and I feel like it's probably something simple.
local cooldown = true local tool = script.Parent local player = game.Players.LocalPlayer if tool.Activated:Connect() then if cooldown == true then script.Parent.Name = "Phase" game.ReplicatedStorage.Phase:FireServer(true) wait(10) cooldown = false end end if cooldown == false then game.ReplicatedStorage.Phase:FireServer(false) script.Parent.Name = "CoolDown" wait(45) cooldown = true end
local cooldown = true local tool = script.Parent local player = game.Players.LocalPlayer script.Parent.Activated:Connect(function() if cooldown == true then script.Parent.Name = "Phase" game.ReplicatedStorage.Phase:FireServer(true) wait(10) cooldown = false if cooldown == false then game.ReplicatedStorage.Phase:FireServer(false) script.Parent.Name = "CoolDown" wait(45) cooldown = true end end end)
Try this^