this is my code
1 | local tool = script.Parent |
2 |
3 |
4 | tool.Activated:Connect( function () |
5 | if tool.Parent = = game.Players.LocalPlayer.Character then |
6 | script.Parent.RemoteEvent:FireServer() |
7 |
8 | end |
9 | end ) |
can you add a debounce please? Thanks?
Next time, you should try to make your own attempt. This is not a request site.
01 | local tool = script.Parent |
02 | local debounce = false |
03 | local cooldown = 1 --Set this to your preferred cooldown. |
04 |
05 | tool.Activated:Connect( function () |
06 | if tool.Parent = = game.Players.LocalPlayer.Character then |
07 | if not debounce then |
08 | script.Parent.RemoteEvent:FireServer() |
09 | wait(cooldown) |
10 | debounce = true |
11 | end |
12 | end |
13 | 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?