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

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?

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.

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!!

Ad