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

How do you disconnect a Remote Event?

Asked by 4 years ago

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.

0
You can't "disconnect" a remote event. Try using a debounce method. Psudar 882 — 4y
0
^ AizakkuZ 226 — 4y
0
What exactly are you trying to achieve? What's going wrong right now? Ankur_007 290 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

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.

Ad

Answer this question