Cannot disconnect an event

For @mekeldev as well, yep don’t worry about this Remote events have a queue behavior it will return the first thing on the queue. You can test it out like this:

:Wait() Queue method
--Server
local remote = script.RemoteEvent

remote:FireAllClients("HELLOFROMSERVER")
--Client
local remote = script.Parent:WaitForChild("RemoteEvent")
print("Waiting on client")
wait(10)
print(remote.OnClientEvent:Wait()) --HelloFromServer
Normal event connection queue behavior
--Server
local remote = script.RemoteEvent

remote:FireAllClients("HELLOFROMSERVER")

local test = {1,2,3,4,5,125,15,12,312,312,3,12}

for i,v in pairs(test) do
	remote:FireAllClients(v)
end
--Client
local remote = script.Parent:WaitForChild("RemoteEvent")
print("Waiting on client")
wait(5)
remote.OnClientEvent:Connect(function(...)
print(...) --prints everything
end)

Also looking further this seems to be a bug, it’s nil because it fires before it returns anything.

3 Likes