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
01--Server side
02rem.OnServerEvent:Connect(function(plr, fruit, move, state, haki) -- Fireflies
03local vector = plr.Backpack.mousehitp.vector
04local cframe = plr.Backpack.mousehit.cframe
05local target = plr.Backpack.mousetarget.target
06    if fruit == "mera" then
07        if move == "fireflies" then
08            if state == "on" then
09                if not firbounce then
10                    firbounce = true
11                    wait(10)
12                    firbounce = false
13                end -- if firbounce
14            end -- if state
15        end -- if move
16    end -- if fruit
17end)

and the script I used to spam

1while wait() do game.ReplicatedStorage.Remotes.fight:FireServer("mera", "fireflies", "on", false) end
2--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