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

How do you disconnect a Remote Event?

Hello, I'm currently making a group only Press E door-- however, to my knowledge, it's impossible to disconnect a remove event, my intended reason to disconnect the remote event is so the else statement is ran, as the first if statement is ignored.

My code:

local event = game.ReplicatedStorage.Events.OpenDoorSecurity

local eventTwo = game.ReplicatedStorage.Events.InvalidDoorClearance

  

event.OnServerEvent:Connect(function(plr, door)

if plr:GetRankInGroup(3902043) == 7 or plr.TeamColor == BrickColor.New("Navy blue") or plr.TeamColor == BrickColor.new("Mid gray") then

local moduleScript = require(door.Scripts.Main)

moduleScript.OpenDoor()

else

local moduleScript = require(door.Scripts.Main)

moduleScript.Invalid()

end

end)

Any help is greatly appreciated.

3 comments

0

You can't "disconnect" a remote event. Try using a debounce method.

0

^

0

What exactly are you trying to achieve? What's going wrong right now?

1 answer

u cant disconnect a remote event

this is roblox

not real life where u get those remotes with buttons on

ok

i hope i helped.

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