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

Is it possible to dis-connect a function?

so like if I go somethingHapped:connect(functionName()) how would i be able to disconnect that function?

2 answers

✓ Accepted answer

If you store the connection (local connection = event:Connect(function)), you can call :Disconnect() on it (connection:Disconnect()).

It really depends which function. Here is an example of a function you could use Disconnect().

game.Players.PlayerAdded:Connect(function))
      --code here
end)
game.Players.PlayerRemoved:Disconnect(function()
      --code here
end)

If this helped please accept this answer.

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