this is my code
local tool = script.Parent tool.Activated:Connect(function() if tool.Parent == game.Players.LocalPlayer.Character then script.Parent.RemoteEvent:FireServer() end end)
can you add a debounce please? Thanks?
Next time, you should try to make your own attempt. This is not a request site.
local tool = script.Parent local debounce = false local cooldown = 1 --Set this to your preferred cooldown. tool.Activated:Connect(function() if tool.Parent == game.Players.LocalPlayer.Character then if not debounce then script.Parent.RemoteEvent:FireServer() wait(cooldown) debounce = true end end end)
Don't forget to accept the answer if this helped!!
Closed as Not Constructive by Nguyenlegiahung, zomspi, Gojinhan, and JesseSong
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?