SHARE
TWEET

Untitled

a guest Jul 22nd, 2019 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. local Mortadex = {}
  3. Mortadex.Version = "1"
  4. Mortadex.Modules = {}
  5. Mortadex.ModuleCount = 0
  6. Mortadex.ModuleSelection = 1
  7.  
  8. Mortadex.Stealth = true -- this will just remove print messages
  9. Mortadex.Debug = false
  10. Mortadex.FreeForAll = false
  11. Mortadex.Studio = false
  12.  
  13. function Mortadex:RegisterModule(name, onrender, norender)
  14.     if Mortadex.Modules[name] then
  15.         return error("Module \""..name.."\" already registered!")
  16.     else
  17.         Mortadex:FLog("Registering module \"%s\"", name)
  18.         Mortadex.Modules[name] = {OnRender = onrender, NoRender = norender, Scratchpad = {}, Enabled = false, Order = Mortadex.ModuleCount}
  19.         Mortadex.ModuleCount = Mortadex.ModuleCount + 1
  20.     end
  21. end
  22.  
  23. function Mortadex:Log(...)
  24.     if Mortadex.Stealth then return end
  25.     return print("[- MORTADEX -] ", ...)
  26. end
  27.  
  28. function Mortadex:FLog(o, ...)
  29.     return Mortadex:Log(o:format(...))
  30. end
  31.  
  32. local getrawmetatable = getrawmetatable
  33.  
  34. ---------------------------------------------------------------
  35.  
  36. Mortadex:Log("Loading core utilities...")
  37.  
  38. Mortadex.HookManager = {IdxHooks = {}, NIdxHooks = {}}
  39. Mortadex.Utilities = {}
  40. Mortadex.Services = {
  41.     Players = game:GetService("Players"),
  42.     Lighting = game:GetService("Lighting"),
  43.     RunService = game:GetService("RunService"),
  44.     UserInputService = game:GetService("UserInputService")
  45. }
  46. Mortadex.Instances = {
  47.     LocalPlayer = Mortadex.Services.Players.LocalPlayer,
  48.     LocalCharacter = Mortadex.Services.Players.LocalPlayer.Character,
  49.     LocalCamera = workspace.CurrentCamera,
  50.     LocalMouse = Mortadex.Services.Players.LocalPlayer:GetMouse()
  51. }
  52.  
  53. function Mortadex.HookManager:Init()
  54.     if getrawmetatable then
  55.         local ObjectMt = getrawmetatable(game)
  56.         Mortadex.OriginalIndex = ObjectMt.__index
  57.         Mortadex.OriginalNewIndex = ObjectMt.__newindex
  58.        
  59.         ObjectMt.__index = function(self, key)
  60.             local Hook = Mortadex.HookManager:LookupIndexHook(self, key)
  61.             if Hook then
  62.                 return Hook(self)
  63.             else
  64.                 return Mortadex.OriginalIndex(self, key)
  65.             end
  66.         end
  67.        
  68.         ObjectMt.__newindex = function(self, key, value)
  69.             local Hook = Mortadex.HookManager:LookupNewIndexHook(self, key)
  70.             if Hook then
  71.                 return Hook(self, value)
  72.             else
  73.                 return Mortadex.OriginalNewIndex(self, key, value)
  74.             end
  75.         end
  76.        
  77.         return true
  78.     end
  79. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top