----- Function to call code from CE Table File
function loadTableCode(n2)
local t2 = findTableFile(n2)
if t2 ~= nil then
local s2 = t2.Stream
local c2 = readStringLocal(s2.Memory,s2.Size)
return c2 ~= nil and loadstring(c2) -- return a function
end
end
----- Executing load code from table file : test.lua
local f2 = loadTableCode('test.lua')
----- Assert load code to check success or not success
if type(f2) == 'function' then f2() else print('not loaded') end
---- Run the function from test.lua
myPrint()
note = [[----------------------------------------------------------------------
1. Add your lua file to CE Table: Table > Add File > Browse your file to add
2. Load your lua file to memory by that function provided above
3. test.lua :
function myPrint()
return print('555')
end
I subtitute your 'function print() to function myPrint()
to prevent confusion 'print as a function' or 'print' as lua command
-----------------------------------------------------------------------------]]
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum