The debounce just doesn't work, there is no delay in how fast points are distributed. (yes the script could be shorter but it's my first script)
function givePointss(hit)
local debounce = false
local thevehicle = hit.Parent
local daseat = thevehicle:FindFirstChild("VehicleSeat")
local p = daseat.Occupant
local player = p.Parent
local daplayer = game.Players:GetPlayerFromCharacter(player)
local coins = daplayer.leaderstats.Coins
if debounce == true then return end
debounce = true
coins.Value = coins.Value +1
wait(5)
debounce = false
end
script.Parent.Touched:connect(givePointss)
COMMUNITY QUESTION
My debounce doesn't work and there is no delay?
1 answer
the debounce should be defined out of the function not inside of it
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
Can you put the code in a code block
ahhhh code without a code block
done