How to disconnect OnServerInvoke

Trying to disconnect OnServerInvoke, but I’m not sure how.

Code:

fireSignal = Remotes.ReloadWeapon.OnServerInvoke = function(...)
	-- yes
end

I’ve tried looking at the page for it, but there’s no information on it, along with the devforum.

Can you not just use?

local fireSignal
fireSignal = Remotes.ReloadWeapon.OnServerInvoke = function(...)
	fireSignal:Disconnect()
end

nope, it’s not possible; throws an error
image

You are using two equal signs in 1 line so it wont work, just try:

local fireSignal
fireSignal = Remotes.ReloadWeapon.OnServerInvoke:Connect(function(...)
    fireSignal:Disconnect()
end)

That’s not how this works, this is not a RemoteEvent.

Whoops sorry yeah, have you tried this: How to stop listening for a RemoteFunction invoke

1 Like

Wow; it seems to work. I’ve never been this confused at a solution, or that you could even do that, or how it even works like that.

Thanks for the response, now it’s time to spend the next 10 hours re-learning remotes and stuff.

3 Likes