46. Call Lua and BASIC functions too
The same definition and caller workflow is available for Lua and BASIC. These two examples return the same amount/label dictionary.
local Script = {}
function Script.describe(amount, label)
return {amount = amount, label = label}
end
return ScriptFUNCTION describe(amount, label)
RETURN {"amount": amount, "label": label}
END FUNCTION1. Create a Lua record lua_tools or BASIC record basic_tools and enter the matching source.
2. Expose describe with amount:int and label:string in that order.
3. Accept the definitions, apply the script editor changes and save.
4. Add or select Call Script Function in the visual caller.
5. Choose the intended language’s helper and verify the result.
The Lua example returns its Script table. The BASIC example uses FUNCTION and END FUNCTION. Neither example needs a default run function because it is called by the named function.
Language syntax still matters inside each helper. Exposure makes the call form consistent; it does not make Lua table syntax interchangeable with JSON or GDScript.
