I want to give 5 coins every time someone touches a block. But I don't want them to rapidly touch it and get a lot of money. so I want to put a 120 seconds time before they can get their money again. But I don't know how to do this.
What you can use is debounce, you can learn about debounce here
But heres an example if you need it:
local debounce = false local function givemoney() -- whatever the money giving code is end game.Workspace.MoneyBlock:Connect(function() -- assume that game.Workspace.MoneyBlock is the block you were describing if debounce == true then return end debounce = true givemoney() wait(120) debounce = false end)
Marked as Duplicate by TheeDeathCaster
This question has been asked before, and already has an answer. If those answers do not fully address your question, then please ask a new question here.
Why was this question closed?