It is not very big as you can see:
Spoiler
So what is this doing ?
It takes either a function or a path to a file and runs it with the given restrictions.
The only function you have to call is :
setEnvironment(functionYouWantToSandbox,TableOfBlockedFunctions,AlternativeFunctionForBlockedOnes)
It will then run your function(or file) and as soon as theres a function that is blocked by the user it will call the function passed through the third argument( if no argument is given it will error at the first occurance of a blocked function with "blocked function!")
Uhm well yeah thats it ^^.
A small example:
blockedFuncs={ os={shutdown=true,reboot=true},setfenv=true,setmetatable=true,shell={run=true}}
setEnvironment(yourFunc,blockedFuncs,function() print("A blocked function was called !") end)
Now if your function contains something like os.shutdown or setmetatable(blah) it would print "A blocked function was called !" instead of actually shutting the computer down for example !
If there are any bugs i will try to fix them !
Pastebin:
http://pastebin.com/2f2qSe4i
Ingame:
pastebin get 2f2qSe4i sandbox
Hope you like it
Kouksi44
Edited by Kouksi44, 04 January 2015 - 09:34 PM.











