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?
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!!
This discussion is preserved as it was. New answers, comments, and votes are closed.