I tried to making a thing where when you click a button it makes your clicks leaderstats go up by 1. I can click fast, so i wanted a cooldown on 1 or 0.5 seconds. Here is my script:
for number = 1, 1 do
script.Parent.MouseButton1Click:Connect(function()
game.Players.LocalPlayer.leaderstats.Clicks.Value = game.Players.LocalPlayer.leaderstats.Clicks.Value + 1
end)
wait(1)
end
Can you tell me why there is no cooldown? Thanks!

2 comments
Although this would work, I would not recommend using a Remote Event; especially when it is unnecessary. Exploiters could abuse this and give themselves as many clicks as they like. You only need to use a single server script; you can still get the player object from the server script, as the script would be a descendant of the player.
Okay!