How to re-call a NET function?

I am using the net library for my addon and I have a net.Send serversided and a net.Receive clientsided.
If I do something like this :



net.Receive("Oof", function() 
    print("Oof")
end)


How do I recall that function later in the code?
Such as :



net.Receive("Oof", function() 
    print("Oof")
end)

Oof() -- ^^ Calling the function from above.


If you simply mean the function you defined in the receive, assign it to a variable. E.g.



local function oof()
  print "oof"
end

net.Receive("Oof", oof)

oof() -- calling later


However, unless you’re calling this function again from a different net receive callback (and understand the data order), you can’t have any net related read functions.

  • SNIP -

Someone commented right before I did with the answer.

I cant use this, this doesn’t work in my scenario. Any other ways?

What do you mean it doesn’t work in your scenario? Could you explain or post an example.

[editline]8th November 2017[/editline]

I mean there is a way to access the function as in your first post using the net.Receivers table, however you shouldn’t need to use this.

Nevermind, I got it. Thanks anyways!