How do I disconnect the OnClientEvent or Disable it?
local a = true
RemoteEvent.OnClientEvent:Connect(function(b)
if a == false then
:Disconnect(b)
end)
How do I disconnect the OnClientEvent or Disable it?
local a = true
RemoteEvent.OnClientEvent:Connect(function(b)
if a == false then
:Disconnect(b)
end)
The :Connect method returns a signal object which you can disconnect to disconnect that signal like so:
local a = true
local connection
connection = RemoteEvent.OnClientEvent:Connect(function(b)
if a == false then
connection:Disconnect()
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.
3 comments
Can i Disconnect the FireClient() on the server?
OmG IM sooo Stupid. (Your right Btw) I just forgot to do someting else.
Thank Ya :)