Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function OverrideEnv()
- local funcDump =
- {
- -- Basics
- "assert","collectgarbage","dofile","error","_G","gcinfo","getfenv","getmetatable","ipairs","load",
- "loadfile","loadstring","newproxy","next","os","pairs","pcall","print","rawequal","rawget","rawset",
- "select","setfenv","setmetatable","tonumber","tostring","type","unpack","_VERSION",
- -- Manipulation and Roblox Functions
- "coroutine","string","table","math","Delay","ElapsedTime","LoadLibrary","printidentity",
- "require","Spawn","tick","time","version","wait","warn","ypcall","game","workspace",
- -- Data Types
- "Axes","BrickColor","CFrame","Color3","Faces","Instance","Ray","Region3","Region3int16",
- "UDim","UDim2","Vector2","Vector3","Vector3int16","Vector2int16","CellId"
- }
- local env = {}
- local currentEnv = getfenv(2)
- for _,v in pairs(funcDump) do
- env[v] = currentEnv[v]
- end
- for k,v in pairs(currentEnv) do
- env[k] = v
- end
- local meta =
- {
- __newindex = function(self,index,value)
- print("Variable: '"..index.."' is getting set to: "..value)
- if rawget(self,index) ~= value then
- rawset(self,index,value)
- end
- end
- }
- setmetatable(env,meta)
- setfenv(2,env)
- end
- return OverrideEnv
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement