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

Remote can still be spammed after using debounce?

Asked by
Elixcore 1337 Moderation Voter
6 years ago
Edited 6 years ago
--Server side
rem.OnServerEvent:Connect(function(plr, fruit, move, state, haki) -- Fireflies
local vector = plr.Backpack.mousehitp.vector
local cframe = plr.Backpack.mousehit.cframe
local target = plr.Backpack.mousetarget.target
    if fruit == "mera" then
        if move == "fireflies" then
            if state == "on" then
                if not firbounce then
                    firbounce = true
                    wait(10)
                    firbounce = false
                end -- if firbounce
            end -- if state
        end -- if move
    end -- if fruit
end)

and the script I used to spam

while wait() do game.ReplicatedStorage.Remotes.fight:FireServer("mera", "fireflies", "on", false) end
--script used to spam

Why does this happen? the first time it executes it's fine but after that it goes crazy.

1
Everything between "firbounce = true" and "firbounce = false" will be debounced. Everything outside will not be affected. ScrewDeath 153 — 6y
0
Where do you create the variable firbounce? OBenjOne 190 — 6y
0
By the way, if fruit, if move and if state will still all run regardless of firbounce. This is because there if statements don't say anything about firbounce.  You knew that, right?  OBenjOne 190 — 6y
0
@obenji the firbounce variable is outside of the OnServentEvent, at the beginning of the script and it's set to false, and yes I am aware but if I put firbouncebefore those then it'll be easily exploited, you just need to summon the remote using the wrong args then summoned again with the right ones would make it spammable Elixcore 1337 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

If it is a Button or a touch event firing the Event add a Debounce to that. I'm not sure you can add Debounces to OnServerEvents.

Ad

Answer this question