So basically i’m wondering if passing an entire function as an argument would be a bad idea, It seems to be a common practice in python, So I just want to make sure lua would handle it 99% of the time.
local ExternalModule = require(game.ExternalModule);
local function RunAtEndLerp()
print("Completed");
end;
local function OnItemTouch()
if condition then
ExternalModule:FireThingy(true, RunAtEndLerp);
end;
end;
ExternalModule:
local module = {};
function module:FireThingy(value1, DoFunction);
if value1 then
--<Does The 'Lerping' Yield;
DoFunction(); --<Then calls the passed function
end
end;
return module;