Okay so basically, I have this script in serverscriptservice:
game.ReplicatedStorage.LightSaberEvent.OnServerEvent:Connect(function(player)
player.leaderstats.Cash.Value = player.leaderstats.Cash.Value + 100000000
workspace[player.Name].LightSaberv1.ManualActivationOnly = true
wait(0.3)
workspace[player.Name].LightSaberv1.ManualActivationOnly = false
end)
and I wanna make an autoclicker cooldown for 5 seconds. The RemoteEvent is: LightSaberEvent
and the replicated storage local script is
script.LightSaberEvent.OnServerEvent:Connect(function()
game.Players.LocalPlayer.leaderstats.Cash.Value = game.Players.LocalPlayer.leaderstats.Cash.Value + 100000000
end)
Basically the same thing. The local script for the tool of the lightsaber is :
player = game.Players.LocalPlayer
script.Parent.Activated:Connect(function()
game.ReplicatedStorage.LightSaberEvent:FireServer()
end)
script.Parent.Equipped:Connect(function()
game.Workspace[player.Name].LightSaberv1.ManualActivationOnly = false
end)
script.Parent.Unequipped:Connect(function()
game.Players[player.Name].Backpack.LightSaberv1.ManualActivationOnly = true
end)
Please help me I'm lost in trying to make an auto clicker cooldown script.

7 comments
This is for 5 seconds. After thats done. Then 20 seconds later the same cooldown for 5 seconds should pop up.
please format your code properly
how?
use a debounce 0.0
whats that
how do you not know what a debounce is? you clearly know how to use remote events and leaderstats
There you go a link for debounce.. https://developer.roblox.com/articles/Debounce