Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Welcome to smartVM by 12packkid, this is a representation of
- everything inside the environment, with cool little new things.
- See if you can find the joke inside the math table! :)
- To change anything in the environment, just go into the 'env' table
- and find what you want to change, change it as you wish! Be careful though!
- To add anything then you need to go into the 'env' table, and either add it
- to a library or add it as part of the global environment.
- THIS IS NOT A SANDBOX!!
- I did not design this to be a sandbox, so don't be surprised if you run this
- and someone kicks you. Although you can change core functions, I did * not *
- intend for this to become a sandbox.
- Thank you, also, to run a piece of code in the virtual machine, go to the
- bottom of the script and call the Wrap function with the correct arguments.
- This has custom error handling as well.
- Thanks, Sam (12packkid).
- ]]
- local CoreFuncs = {
- ["MoveTable"] = function(table1,table2)
- for i,v in pairs(table2) do
- if type(i) == "string" then
- table1[i] = v
- else
- table.insert(table1,v)
- end
- end
- end
- }
- local env = {
- table = {
- insert = table.insert;
- remove = table.remove;
- getn = table.getn;
- sort = table.sort;
- foreach = table.foreach;
- foreachi = table.foreachi;
- concat = table.concat;
- unpack = unpack;
- maxn = table.maxn;
- move = CoreFuncs.MoveTable;
- };
- string = {
- sub = string.sub;
- char = string.char;
- byte = string.byte;
- upper = string.upper;
- lower = string.lower;
- dump = string.dump; -- does not return actual dump
- match = string.match;
- len = string.len;
- gmatch = string.gmatch;
- gsub = string.gsub;
- format = string.format;
- find = string.find;
- reverse = string.reverse;
- rep = string.rep;
- convertNumber = tonumber;
- convertString = tostring;
- };
- math = {
- random = math.random;
- over9000 = 9001;
- pi = math.pi;
- max = math.max;
- min = math.min;
- huge = math.huge;
- sin = math.sin;
- tan = math.tan;
- cos = math.cos;
- acos = math.acos;
- atan = math.atan;
- asin = math.asin;
- tanh = math.tanh;
- abs = math.abs;
- sqrt = math.sqrt;
- cosh = math.cosh;
- randomseed = math.randomseed;
- pow = math.pow;
- exp = math.exp;
- fmod = math.fmod;
- frexp = math.frexp;
- floor = math.floor;
- ceil = math.ceil;
- log = math.log;
- log10 = math.log10;
- rad = math.rad;
- ldexp = math.ldexp;
- deg = math.deg;
- atan2 = math.atan2;
- };
- io = {};
- debug = {};
- os = {
- time = os.time;
- difftime = os.difftime;
- };
- print = print;
- assert = assert;
- error = error;
- loadstring = loadstring;
- setmetatable = setmetatable;
- getmetatable = getmetatable;
- newproxy = newproxy;
- dofile = dofile; -- cannot be used in rbx.lua
- load = load; -- cannot be used in rbx.lua - see dofile
- loadfile = loadfile; -- cannot be usd in rbx.lua - see load/dofile
- getfenv = getfenv;
- setfenv = setfenv;
- Game = game;
- game = game;
- workspace = workspace;
- Workspace = workspace;
- Instance = {
- new = Instance.new;
- Lock = Instance.Lock;
- Unlock = Instance.Unlock;
- };
- CFrame = {
- new = CFrame.new;
- fromEulerAnglesXYZ = CFrame.fromEulerAnglesXYZ;
- fromAxisAngle = CFrame.fromAxisAngle;
- Angles = CFrame.Angles;
- };
- Vector3 = {
- new = Vector3.new;
- FromAxis = Vector3.FromAxis;
- FromNormalId = Vector3.FromNormalId;
- };
- coroutine = {
- resume = coroutine.resume;
- create = coroutine.create;
- yield = coroutine.yield;
- status = coroutine.status;
- running = coroutine.running;
- wrap = coroutine.wrap;
- };
- UDim2 = {
- new = UDim2.new;
- };
- Vector2 = {
- new = Vector2.new;
- };
- Spawn = spawn;
- spawn = spawn;
- pcall = pcall;
- ypcall = ypcall;
- xpcall = xpcall;
- rawget = rawget;
- rawset = rawset;
- rawequal = rawequal;
- type = type;
- tonumber = tonumber;
- tostring = tostring;
- _VERSION = _VERSION;
- _VERSION2 = "12packkid's VM v0.25";
- unpack = unpack;
- select = select;
- next = next;
- pairs = pairs;
- ipairs = ipairs;
- _G = _G;
- gcinfo = gcinfo;
- collectgarbage = collectgarbage;
- wait = wait;
- Wait = wait;
- }
- function Wrap(c)
- for i,v in pairs(env) do
- getfenv(c)[i] = v;
- end
- local a,b = spawn(function()
- c()
- end)
- if not a then
- getfenv(c).print(b)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement