i have a remote function to send and receive a table from client to server, but calling upon this remote function takes a pretty long line of code. how will the remote function act in a local variable? will the remote function only get invoked once? or will it be invoked every time the variable is referenced?
update: i ended up putting the reference line to the remote function into a local function, and having the local function return the returned value from the remote function. this should have it invoke the remote function every time the local function is referenced, right?

4 comments
I can't post an answer yet because I just posted one and am on a cooldown, but the remote function will only be invoked when assigning the variable.
I can't post an answer yet because I just posted one and am on a cooldown, but the remote function will only be invoked when assigning the variable. Obviously, you will have to return a value in your remote function script for it to assign the variable anything other than nil.
Local variables are basically a global. Local functions are functions that run on its own scope. So by your question, the remote function will be invoked every time the variable is referenced, as its not a local function.
variables are quick and can save a lot of time writing code.