Skip to content

Instantly share code, notes, and snippets.

@pajlada
Created August 24, 2014 15:29
Show Gist options
  • Save pajlada/8870f4b58154976513d2 to your computer and use it in GitHub Desktop.
Save pajlada/8870f4b58154976513d2 to your computer and use it in GitHub Desktop.
-- First luascript (id 5)
function my_custom_function()
local id1 = 5
local id2 = 10
local id3 = 20
return id1, id2, id3
end
-- Second luascript
function init()
my_lua = world:get_entity(5)
end
function step()
local id1, id2, id3 = my_lua:call("my_custom_function")
-- do what you wish with the id1, id2, id3
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment