Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Remote can still be spammed after using debounce?

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

4 comments

1

Everything between "firbounce = true" and "firbounce = false" will be debounced. Everything outside will not be affected.

0

Where do you create the variable firbounce?

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? 

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

1 answer

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.