Is it possible to run a function and return a value while code is still being executed within? If so, how would I go about doing so?
Technically speaking, no there isn't any way to use the return
statement in a function without discontinuation occurring.
But there is an alternative. You can just define a value before running the function, and have a parameter inside the function which will be set to whatever value you want
Example;
function derp(argument, variableParam) --code variableParam = 0 --code end local a = 1 derp(argument,a)
Now,'a' will be set to 0 whenever the function derp runs.. so it's kinda like returning a value(: