OfficialArponAG

DarkDex v3

Apr 10th, 2020
4,907
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.59 KB | None | 0 0
  1. if game:GetService'CoreGui':FindFirstChild'Dex' then
  2.     game:GetService'CoreGui'.Dex:Destroy();
  3. end
  4.  
  5. math.randomseed(tick())
  6.  
  7. local charset = {}
  8. for i = 48,  57 do table.insert(charset, string.char(i)) end
  9. for i = 65,  90 do table.insert(charset, string.char(i)) end
  10. for i = 97, 122 do table.insert(charset, string.char(i)) end
  11. function RandomCharacters(length)
  12.   if length > 0 then
  13.     return RandomCharacters(length - 1) .. charset[math.random(1, #charset)]
  14.   else
  15.     return ""
  16.   end
  17. end
  18.  
  19. local Dex = game:GetObjects("rbxassetid://3567096419")[1]
  20. Dex.Name = RandomCharacters(math.random(5, 20))
  21. Dex.Parent = game:GetService("CoreGui")
  22.    
  23. local function Load(Obj, Url)
  24. local function GiveOwnGlobals(Func, Script)
  25.     local Fenv = {}
  26.     local RealFenv = {script = Script}
  27.     local FenvMt = {}
  28.     FenvMt.__index = function(a,b)
  29.         if RealFenv[b] == nil then
  30.             return getfenv()[b]
  31.         else
  32.             return RealFenv[b]
  33.         end
  34.     end
  35.     FenvMt.__newindex = function(a, b, c)
  36.         if RealFenv[b] == nil then
  37.             getfenv()[b] = c
  38.         else
  39.             RealFenv[b] = c
  40.         end
  41.     end
  42.     setmetatable(Fenv, FenvMt)
  43.     setfenv(Func, Fenv)
  44.     return Func
  45. end
  46.  
  47. local function LoadScripts(Script)
  48.     if Script.ClassName == "Script" or Script.ClassName == "LocalScript" then
  49.         spawn(function()
  50.             GiveOwnGlobals(loadstring(Script.Source, "=" .. Script:GetFullName()), Script)()
  51.         end)
  52.     end
  53.     for i,v in pairs(Script:GetChildren()) do
  54.         LoadScripts(v)
  55.     end
  56. end
  57.  
  58. LoadScripts(Obj)
  59. end
  60.  
  61. Load(Dex)
Add Comment
Please, Sign In to add comment