Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

Need Help With A Tool Debounce I Need You To Help Script It? [closed]

Asked by
iWasThisi -15
4 years ago

this is my code

1local tool = script.Parent
2 
3 
4tool.Activated:Connect(function()
5    if tool.Parent == game.Players.LocalPlayer.Character then
6        script.Parent.RemoteEvent:FireServer()
7 
8    end
9end)

can you add a debounce please? Thanks?

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?

1 answer

Log in to vote
1
Answered by
DesertusX 435 Moderation Voter
4 years ago
Edited 4 years ago

Next time, you should try to make your own attempt. This is not a request site.

01local tool = script.Parent
02local debounce = false
03local cooldown = 1 --Set this to your preferred cooldown.   
04 
05tool.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
13end)

Don't forget to accept the answer if this helped!!

Ad