Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TableOfCodes={}
- _G.create=function(Name, Table)
- TableOfCodes[Name]={}
- for i,v in pairs(Table) do
- TableOfCodes[Name][i]=v
- end
- end
- _G.include=function(Name)
- local Environment=getfenv(2)
- if not TableOfCodes[Name] then error("No packet called '"..Name.."'.") return false end
- for i,v in pairs(TableOfCodes[Name]) do
- Environment[i]=v
- end
- setfenv(2, Environment)
- end
- _G.create("Test", {Factorial=function (x)
- y=1
- for i=x,1,-1 do
- y=y*i
- end
- return y
- end})
Advertisement
Add Comment
Please, Sign In to add comment