Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Dex = game:GetObjects("rbxassetid://3567096419")[1]
- Dex.Name = "Dex"
- Dex.Parent = game:GetService("CoreGui")
- local function Load(Obj, Url)
- local function GiveOwnGlobals(Func, Script)
- local Fenv = {}
- local RealFenv = {
- script = Script
- }
- local FenvMt = {}
- FenvMt.__index = function(a, b)
- if RealFenv[b] == nil then
- return getfenv()[b]
- else
- return RealFenv[b]
- end
- end
- FenvMt.__newindex = function(a, b, c)
- if RealFenv[b] == nil then
- getfenv()[b] = c
- else
- RealFenv[b] = c
- end
- end
- setmetatable(Fenv, FenvMt)
- setfenv(Func, Fenv)
- return Func
- end
- local function LoadScripts(Script)
- if Script.ClassName == "Script" or Script.ClassName == "LocalScript" then
- pcall(coroutine.wrap(function()
- GiveOwnGlobals(loadstring(Script.Source, "=" .. Script:GetFullName()), Script)()
- end))
- end
- for _, v in pairs(Script:GetChildren()) do
- pcall(LoadScripts, v)
- end
- end
- pcall(LoadScripts, Obj)
- end
- pcall(Load, Dex)
Add Comment
Please, Sign In to add comment