How do I make it so that whenever a player uses a tool, they get +1 leaderstat currency and they have to wait to use it again?
I have used this script
Tool = script.Parent -- Define your tool
Players = game:GetService('Players')
Tool.Activated:Connect(function()
local Player = Players:GetPlayerFromCharacter(Tool.Parent)
if Player then
if Player:FindFirstChild('leaderstats') and Player.leaderstats:FindFirstChild('Points') then
Player.leaderstats.Points.Value = Player.leaderstats.Points.Value + 1
end
end
end)
But the players can just spam click and get 100 points a minute. So how do I add a cooldown to this script?
