Script_Master132

nice phantom

Dec 2nd, 2018
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 34.63 KB | None | 0 0
  1. -- MORTADEX
  2. -- WRITTEN BY LOUKA @ V3RMILLION
  3. -- DON'T JEW THE LOCALSCRIPT IF YOU DON'T KNOW HOW TO SCRIPT
  4.  
  5. local Mortadex = {}
  6. Mortadex.Version = "1"
  7. Mortadex.Modules = {}
  8. Mortadex.ModuleCount = 0
  9. Mortadex.ModuleSelection = 1
  10.  
  11. Mortadex.Stealth = true -- this will just remove print messages
  12. Mortadex.Debug = false
  13. Mortadex.FreeForAll = false
  14. Mortadex.Studio = false
  15.  
  16. function Mortadex:RegisterModule(name, onrender, norender)
  17. if Mortadex.Modules[name] then
  18. return error("Module \""..name.."\" already registered!")
  19. else
  20. Mortadex:FLog("Registering module \"%s\"", name)
  21. Mortadex.Modules[name] = {OnRender = onrender, NoRender = norender, Scratchpad = {}, Enabled = false, Order = Mortadex.ModuleCount}
  22. Mortadex.ModuleCount = Mortadex.ModuleCount + 1
  23. end
  24. end
  25.  
  26. function Mortadex:Log(...)
  27. if Mortadex.Stealth then return end
  28. return print("[- MORTADEX -] ", ...)
  29. end
  30.  
  31. function Mortadex:FLog(o, ...)
  32. return Mortadex:Log(o:format(...))
  33. end
  34.  
  35. local getrawmetatable = getrawmetatable
  36.  
  37. ---------------------------------------------------------------
  38.  
  39. Mortadex:Log("Loading core utilities...")
  40.  
  41. Mortadex.HookManager = {IdxHooks = {}, NIdxHooks = {}}
  42. Mortadex.Utilities = {}
  43. Mortadex.Services = {
  44. Players = game:GetService("Players"),
  45. Lighting = game:GetService("Lighting"),
  46. RunService = game:GetService("RunService"),
  47. UserInputService = game:GetService("UserInputService")
  48. }
  49. Mortadex.Instances = {
  50. LocalPlayer = Mortadex.Services.Players.LocalPlayer,
  51. LocalCharacter = Mortadex.Services.Players.LocalPlayer.Character,
  52. LocalCamera = workspace.CurrentCamera,
  53. LocalMouse = Mortadex.Services.Players.LocalPlayer:GetMouse()
  54. }
  55.  
  56. function Mortadex.HookManager:Init()
  57. if getrawmetatable then
  58. local ObjectMt = getrawmetatable(game)
  59. Mortadex.OriginalIndex = ObjectMt.__index
  60. Mortadex.OriginalNewIndex = ObjectMt.__newindex
  61.  
  62. ObjectMt.__index = function(self, key)
  63. local Hook = Mortadex.HookManager:LookupIndexHook(self, key)
  64. if Hook then
  65. return Hook(self)
  66. else
  67. return Mortadex.OriginalIndex(self, key)
  68. end
  69. end
  70.  
  71. ObjectMt.__newindex = function(self, key, value)
  72. local Hook = Mortadex.HookManager:LookupNewIndexHook(self, key)
  73. if Hook then
  74. return Hook(self, value)
  75. else
  76. return Mortadex.OriginalNewIndex(self, key, value)
  77. end
  78. end
  79.  
  80. return true
  81. end
  82. end
  83.  
  84. function Mortadex.HookManager:LookupIndexHook(inst, key)
  85. for _, Hook in next, Mortadex.HookManager.IdxHooks do
  86. if Mortadex.OriginalIndex(inst, "IsA")(inst, Hook.AffectedClass) and Hook.Property == key then
  87. return Hook.HookFunction
  88. end
  89. end
  90. end
  91.  
  92. function Mortadex.HookManager:LookupNewIndexHook(inst, key)
  93. for _, Hook in next, Mortadex.HookManager.NIdxHooks do
  94. if Mortadex.OriginalIndex(inst, "IsA")(inst, Hook.AffectedClass) and Hook.Property == key then
  95. return Hook.HookFunction
  96. end
  97. end
  98. end
  99.  
  100. function Mortadex.HookManager:HookIndex(class, prop, f)
  101. return table.insert(Mortadex.HookManager.IdxHooks, {AffectedClass = class, Property = prop, HookFunction = f})
  102. end
  103.  
  104. function Mortadex.HookManager:HookNewIndex(class, prop, f)
  105. return table.insert(Mortadex.HookManager.NIdxHooks, {AffectedClass = class, Property = prop, HookFunction = f})
  106. end
  107.  
  108. function Mortadex.Utilities:WorldToScreenPoint(...)
  109. return Mortadex.Instances.LocalCamera:WorldToScreenPoint(...)
  110. end
  111.  
  112. function Mortadex.Utilities:PathObstructed(p1, p2, ...)
  113. local ray = Ray.new(p1, (p2 - p1).unit * 500)
  114. local haspart, hitpos = workspace:FindPartOnRayWithIgnoreList(ray, {...})
  115. if haspart then return true, hitpos else return false end
  116. end
  117.  
  118. function Mortadex.Utilities:GetReplicator()
  119. return game:FindFirstChild("ClientReplicator", true)
  120. end
  121.  
  122. function Mortadex.Utilities:GetSize(i)
  123. if i:IsA("BasePart") then
  124. return i.Size
  125. elseif i:IsA("Model") then
  126. return i:GetExtentsSize()
  127. end
  128. end
  129.  
  130. function Mortadex.Utilities:GetPlayers(mode)
  131. local Result = {}
  132. for _,player in next, Mortadex.Services.Players:GetPlayers() do
  133. if mode == 0 then -- exclude players in current team
  134. if (player ~= Mortadex.Instances.LocalPlayer and (Mortadex.Instances.LocalPlayer.TeamColor ~= player.TeamColor or (FreeForAll or DEBUG))) then
  135. table.insert(Result, player)
  136. end
  137. else -- include everyone
  138. table.insert(Result, player)
  139. end
  140. end
  141. return Result
  142. end
  143.  
  144. function Mortadex.Utilities:GetNearestPlayer()
  145. if not Mortadex.Instances.LocalPlayer.Character then return end
  146. local Players = Mortadex.Utilities:GetPlayers(0)
  147. local SelectedPlayer, SelectedPlayerPrevDistance = nil, 25000
  148. for i,v in next, Players do
  149. if v.Character and v.Character:FindFirstChild("HumanoidRootPart") then
  150. local Distance = Mortadex.Utilities:GetDistance(Mortadex.Instances.LocalPlayer.Character.HumanoidRootPart.Position, v.Character.HumanoidRootPart.Position)
  151. if Distance < SelectedPlayerPrevDistance then
  152. SelectedPlayer = v
  153. SelectedPlayerPrevDistance = Distance
  154. end
  155. end
  156. end
  157. return SelectedPlayer
  158. end
  159.  
  160. function Mortadex.Utilities:GetDistance(v1, v2)
  161. return (v1 - v2).magnitude
  162. end
  163.  
  164. function Mortadex.Utilities:GetCanvas()
  165. if not Mortadex.Canvas then
  166. if getrawmetatable then
  167. Mortadex.Canvas = Instance.new("ScreenGui", game:GetService("CoreGui"))
  168. else
  169. Mortadex.Canvas = Instance.new("ScreenGui", Mortadex.Services.Players.LocalPlayer.PlayerGui)
  170. end
  171. end
  172. return Mortadex.Canvas
  173. end
  174.  
  175. Mortadex.EmptyVector3 = Vector3.new()
  176. Mortadex.EmptyCFrame = CFrame.new()
  177.  
  178. ---------------------------------------------------------------
  179.  
  180. --> ESP
  181. Mortadex:RegisterModule("ESP", function(Storage)
  182. local Canvas = Mortadex.Utilities:GetCanvas()
  183. local Root = Canvas:FindFirstChild("ESP")
  184. if not Root then
  185. Root = Instance.new("Frame")
  186. Root.Name = "ESP"
  187. Root.Size = UDim2.new(1, 0, 1, 0)
  188. Root.BackgroundTransparency = 1
  189. end
  190.  
  191. Root:ClearAllChildren()
  192. for _, Player in next, Mortadex.Utilities:GetPlayers(0) do
  193. if Player.Character and Player.Character:FindFirstChild("Torso") then
  194. local Locator = Instance.new("Frame")
  195. Locator.BackgroundColor = Player.TeamColor
  196. Locator.BackgroundTransparency = .5
  197. local VPos, VVis = Mortadex.Utilities:WorldToScreenPoint(Player.Character.Torso.Position)
  198. if VVis then
  199. Locator.Size = UDim2.new(0, -2800 / VPos.z, 0, -4300 / VPos.z)
  200. Locator.Position = UDim2.new(0, VPos.x - Locator.Size.X.Offset / 2, 0, VPos.y - Locator.Size.Y.Offset / 2)
  201. local Name = Instance.new("TextLabel")
  202. Name.TextColor3 = Color3.new(1,1,1)
  203. Name.Size = UDim2.new(1,0,0, Locator.Size.Y.Offset / 5)
  204. Name.BackgroundTransparency = 1
  205. Name.TextScaled = true
  206. Name.FontSize = 'Size24'
  207. Name.Text = Player.Name
  208. Name.TextStrokeTransparency = .3
  209. Name.Font = 'SourceSansLight'
  210. Name.TextXAlignment = 'Left'
  211. Name.Parent = Locator
  212. Locator.Parent = Root
  213. else
  214. Locator:Destroy()
  215. end
  216. end
  217. end
  218.  
  219. if not Root.Parent then
  220. Root.Parent = Canvas
  221. end
  222. end)
  223.  
  224. --> FreeForAll
  225. Mortadex:RegisterModule("FreeForAll", function(Storage)
  226. FreeForAll = true
  227. end, function(Storage) FreeForAll = false end)
  228.  
  229. --> Chams
  230. Mortadex:RegisterModule("Chams", function(Storage)
  231. for i, Cham in next, Storage do
  232. if Cham.Name:find("Cham") then
  233. Cham:Destroy()
  234. Storage[i] = nil
  235. end
  236. end
  237.  
  238. for _, Player in next, Mortadex.Utilities:GetPlayers(0) do
  239. if Player.Character and Player.Character:FindFirstChild("Torso") then
  240. for _, Part in next, Player.Character:GetChildren() do
  241. if Part:IsA("PVInstance") then
  242. local Box = Instance.new("BoxHandleAdornment")
  243. Box.Size = Mortadex.Utilities:GetSize(Part) + Vector3.new(.2, .2, .2)
  244. Box.Name = "Cham" .. Player.Name
  245. Box.Color3 = Player.TeamColor.Color
  246. Box.Adornee = Part
  247. Box.AlwaysOnTop = true
  248. Box.ZIndex = 5
  249. Box.Transparency = .1
  250. table.insert(Storage, Box)
  251. Box.Parent = Mortadex.Utilities:GetCanvas()
  252. end
  253. end
  254. end
  255. end
  256. end)
  257.  
  258. --> LagSwitch
  259. Mortadex:RegisterModule("LagSwitch", function(Storage)
  260. if not Storage.State then
  261. Storage.State = true
  262. local Replicator = Mortadex.Utilities:GetReplicator()
  263. if Replicator then
  264. Replicator:DisableProcessPackets()
  265. end
  266. end
  267. end,
  268.  
  269. function(Storage)
  270. if Storage.State then
  271. Storage.State = false
  272. local Replicator = Mortadex.Utilities:GetReplicator()
  273. if Replicator then
  274. Replicator:EnableProcessPackets()
  275. end
  276. end
  277. end)
  278.  
  279. --> IronSight
  280. Mortadex:RegisterModule("IronSight", function(Storage)
  281. local Sight = Instance.new("Frame")
  282. Sight.Size = UDim2.new(0, 5, 0, 5)
  283. Sight.BackgroundTransparency = .5
  284. Sight.BackgroundColor3 = Color3.new(1, 1, 1)
  285. Sight.Position = UDim2.new(0, Mortadex.Instances.LocalMouse.X, 0, Mortadex.Instances.LocalMouse.Y)
  286. Sight.Parent = Mortadex.Utilities:GetCanvas()
  287. end)
  288.  
  289. --> KnifeMaster
  290. Mortadex:RegisterModule("KnifeMaster", function(Storage)
  291. if not Mortadex.Instances.LocalPlayer.Character then
  292. return
  293. end
  294. local Pl = Mortadex.Utilities:GetNearestPlayer()
  295. if Pl and Pl.Character and Mortadex.Utilities:GetDistance(Pl.Character.Torso.Position, Mortadex.Instances.LocalPlayer.Character.HumanoidRootPart.Position) < 150 then
  296. Mortadex.Instances.LocalPlayer.Character.HumanoidRootPart.CFrame = Pl.Character.Torso.CFrame * CFrame.new(0,0,3)
  297. end
  298. end)
  299.  
  300. --> BigHead
  301. Mortadex:RegisterModule("BigHead", function(Storage)
  302. for _, v in next, Mortadex.Utilities:GetPlayers(0) do
  303. if v.Character then
  304. if not Storage[v.Name] then
  305. Storage[v.Name] = { v.Character.Head.Size, v.Character.Head.CFrame }
  306. end
  307. v.Character.Head.CanCollide = false
  308. v.Character.Head.Size = Vector3.new(40, 40, 40)
  309. v.Character.Head.CFrame = v.Character.Torso.CFrame * CFrame.new(0, 20, 0)
  310. v.Character.Head.Transparency = .3
  311. end
  312. end
  313. end,
  314.  
  315. function(Storage)
  316. if not Storage.NormalSize then
  317. Storage.NormalSize = Vector3.new(2, 1, 1)
  318. end
  319.  
  320. for _, v in next, Mortadex.Utilities:GetPlayers(0) do
  321. if v.Character then
  322. v.Character.Head.CanCollide = true
  323. v.Character.Head.Size = Storage.NormalSize
  324. end
  325. end
  326. end)
  327.  
  328. ---------------------------------------------------------------
  329.  
  330. Mortadex:Log("Loading UI...")
  331.  
  332. function Mortadex:CreateWindow(name, size, timed_close, tween)
  333. local TopBar = Instance.new("TextLabel")
  334. TopBar.Name = "NO_CLEAR"
  335. TopBar.Size = UDim2.new(size.X.Scale, size.X.Offset, 0, 20)
  336. TopBar.BorderSizePixel = 0
  337. TopBar.BackgroundColor3 = Color3.new(1, 0, 0)
  338. TopBar.Text = name
  339. TopBar.TextXAlignment = Enum.TextXAlignment.Left
  340. TopBar.TextScaled = true
  341. TopBar.Font = Enum.Font.Code
  342. TopBar.TextColor3 = Color3.new(0, 0, 0)
  343. TopBar.Position = UDim2.new(.5, -(size.X.Offset/2), .5, -(size.Y.Offset/2))
  344. TopBar.Draggable = true
  345. TopBar.Active = true
  346.  
  347. local Window = Instance.new("Frame")
  348. Window.Name = "Content"
  349. Window.Size = size
  350. Window.BackgroundColor3 = Color3.new(0, 0, 0)
  351. Window.Position = UDim2.new(0, 0, 0, 20)
  352. Window.BackgroundTransparency = .3
  353. Window.BorderSizePixel = 0
  354.  
  355. if not timed_close then
  356. local CloseBtn = Instance.new("TextButton", TopBar)
  357. CloseBtn.Position = UDim2.new(1, -20, 0, 0)
  358. CloseBtn.Size = UDim2.new(0, 20, 1, 0)
  359. CloseBtn.BorderSizePixel = 0
  360. CloseBtn.Name = "CloseBtn"
  361. CloseBtn.BackgroundColor3 = Color3.new(0,0,0)
  362. CloseBtn.TextColor3 = Color3.new(1, 0, 0)
  363. CloseBtn.Text = "X"
  364. CloseBtn.MouseButton1Click:connect(function()
  365. TopBar:Destroy()
  366. end)
  367. else
  368. local Countdown = Instance.new("TextLabel", TopBar)
  369. Countdown.Position = UDim2.new(1, -20, 0, 0)
  370. Countdown.Size = UDim2.new(0, 20, 1, 0)
  371. Countdown.BackgroundTransparency = 1
  372. Countdown.TextColor3 = Color3.new(0, 0, 0)
  373. Countdown.Text = tostring(timed_close)
  374. local BackPos
  375. if tween then
  376. BackPos = TopBar.Position
  377. TopBar.Position = UDim2.new(.5, -(size.X.Offset/2), 1, 0)
  378. end
  379. spawn(function()
  380. if tween then
  381. TopBar:TweenPosition(BackPos, "Out", "Quad", .3, true)
  382. end
  383. for i = timed_close-1, 0, -1 do
  384. wait(1)
  385. Countdown.Text = tostring(i)
  386. end
  387. if not tween then
  388. TopBar:Destroy()
  389. else
  390. TopBar:TweenPosition(UDim2.new(.5, -(size.X.Offset/2), 1, 0), "Out", "Sine", .3, true)
  391. wait(.3)
  392. TopBar:Destroy()
  393. end
  394. end)
  395. end
  396.  
  397. Window.Parent = TopBar
  398. TopBar.Parent = Mortadex.Utilities:GetCanvas()
  399. return TopBar
  400. end
  401.  
  402.  
  403. ---------------------------------------------------------------
  404.  
  405. if not script then script = Instance.new("LocalScript") end
  406. Mortadex.UpvalScript = script
  407.  
  408. Mortadex:Log("Hooking functions...")
  409. Mortadex.HookManager:Init()
  410. Mortadex.HookManager:HookIndex("Player", "Kick", error)
  411. Mortadex.HookManager:HookIndex("BasePart", "Size", function(Part)
  412. local caller_env = getfenv(1)
  413. if caller_env.script ~= Mortadex.UpvalScript and caller_env.script.ClassName ~= "CoreScript" then
  414. if Part.Name == "Head" then
  415. return Mortadex.EmptyVector3
  416. end
  417. end
  418. return Mortadex.OriginalIndex(Part, "Size")
  419. end)
  420.  
  421. Mortadex.HookManager:HookIndex("BasePart", "CFrame", function(Part)
  422. local caller_env = getfenv(1)
  423. if caller_env.script ~= Mortadex.UpvalScript and caller_env.script.ClassName ~= "CoreScript" then
  424. if Part.Name == "Head" then
  425. return Mortadex.EmptyCFrame
  426. end
  427. end
  428. return Mortadex.OriginalIndex(Part, "CFrame")
  429. end)
  430.  
  431. Mortadex.HookManager:HookIndex("BasePart", "Transparency", function(Part)
  432. local caller_env = getfenv(1)
  433. if caller_env.script ~= Mortadex.UpvalScript and caller_env.script.ClassName ~= "CoreScript" then
  434. if Part.Name == "Head" then
  435. return 0
  436. end
  437. end
  438. return Mortadex.OriginalIndex(Part, "Transparency")
  439. end)
  440.  
  441. Mortadex:Log("Creating menu...")
  442. Mortadex.SelectionMenu = Mortadex:CreateWindow("Mortadex v"..Mortadex.Version, UDim2.new(0, 250, 0, 20 * Mortadex.ModuleCount))
  443. Mortadex.SelectionMenu.Position = UDim2.new(0, 10, 0, 10)
  444. Mortadex.SelectionMenu.CloseBtn:Destroy()
  445.  
  446. for ModuleName, Module in next, Mortadex.Modules do
  447. local Entry = Instance.new("TextLabel")
  448. Entry.BackgroundTransparency = 1
  449. Entry.BackgroundColor3 = Color3.new(1,1,1)
  450. Entry.TextColor3 = Color3.new(1, 1, 1)
  451. Entry.TextScaled = true
  452. Entry.Font = "Code"
  453. Entry.TextXAlignment = "Left"
  454. Entry.Text = ModuleName
  455. Entry.Position = UDim2.new(0, 0, 0, 20 * Module.Order)
  456. Entry.Size = UDim2.new(1, 0, 0, 20)
  457. Entry.Name = tostring(Module.Order)
  458. Entry.Parent = Mortadex.SelectionMenu.Content
  459. Entry.BorderSizePixel = 0
  460.  
  461. local Status = Instance.new("Frame")
  462. Status.BorderSizePixel = 0
  463. Status.BackgroundColor3 = Color3.new(1, 0, 0)
  464. Status.Size = UDim2.new(0, 5, 0, 5)
  465. Status.Position = UDim2.new(1, -10, 0, 8)
  466. Status.Name = "Status"
  467. Status.Parent = Entry
  468. end
  469.  
  470. Mortadex:Log("Connecting UI renderer...")
  471. Mortadex.Services.RunService:BindToRenderStep("Mortadex", Enum.RenderPriority.Last.Value + 1, function()
  472. for _, Object in next, Mortadex.Utilities:GetCanvas():GetChildren() do
  473. if not Object.Name:find("NO_CLEAR") then
  474. Object:Destroy()
  475. end
  476. end
  477.  
  478. for i, Module in next, Mortadex.Modules do
  479. if Module.Enabled and Module.OnRender then
  480. local Success, ErrMsg = pcall(Module.OnRender, Module.Scratchpad)
  481. if not Success then
  482. Mortadex:FLog("Panic during execution of \"%s\"::OnRender: %s", i, ErrMsg)
  483. end
  484. elseif not Module.Enabled and Module.NoRender then
  485. local Success, ErrMsg = pcall(Module.NoRender, Module.Scratchpad)
  486. if not Success then
  487. Mortadex:FLog("Panic during execution of \"%s\"::NoRender: %s", i, ErrMsg)
  488. end
  489. end
  490. end
  491. end)
  492.  
  493. Mortadex:Log("Attaching controls...")
  494. Mortadex.Services.UserInputService.InputBegan:connect(function(InputObject)
  495. local PreviousSelection = Mortadex.SelectionMenu.Content:FindFirstChild(tostring(Mortadex.ModuleSelection))
  496. if PreviousSelection then
  497. PreviousSelection.BackgroundTransparency = 1
  498. PreviousSelection.TextColor3 = Color3.new(1, 1, 1)
  499. end
  500. if InputObject.KeyCode.Name == "J" then
  501. Mortadex.ModuleSelection = Mortadex.ModuleSelection - 1
  502. if Mortadex.ModuleSelection < 0 then
  503. Mortadex.ModuleSelection = Mortadex.ModuleCount - 1
  504. end
  505. elseif InputObject.KeyCode.Name == "K" then
  506. Mortadex.ModuleSelection = Mortadex.ModuleSelection + 1
  507. if Mortadex.ModuleSelection > Mortadex.ModuleCount-1 then
  508. Mortadex.ModuleSelection = 0
  509. end
  510. elseif InputObject.KeyCode.Name == "L" then
  511. local EntryLabel = Mortadex.SelectionMenu.Content:FindFirstChild(tostring(Mortadex.ModuleSelection))
  512. if EntryLabel then
  513. local ModuleEntry = Mortadex.Modules[EntryLabel.Text]
  514. if ModuleEntry then
  515. ModuleEntry.Enabled = not ModuleEntry.Enabled
  516. if ModuleEntry.Enabled then
  517. EntryLabel.Status.BackgroundColor3 = Color3.new(0, 1, 0)
  518. else
  519. EntryLabel.Status.BackgroundColor3 = Color3.new(1, 0, 0)
  520. end
  521. end
  522. end
  523. elseif InputObject.KeyCode.Name == "P" then
  524. Mortadex.SelectionMenu.Position = UDim2.new(1, -270, 0, 10)
  525. end
  526. local EntryLabel = Mortadex.SelectionMenu.Content:FindFirstChild(tostring(Mortadex.ModuleSelection))
  527. if EntryLabel then
  528. EntryLabel.BackgroundTransparency = .3
  529. EntryLabel.TextColor3 = Color3.new(0, 0, 0)
  530. end
  531. end)
  532.  
  533. Mortadex:Log("Finishing up...")
  534. local IntroWindow = Mortadex:CreateWindow("Mortadex", UDim2.new(0, 350, 0, 200), 5, true)
  535. local IntroLabel = Instance.new("TextLabel")
  536. IntroLabel.Font = "Code"
  537. IntroLabel.TextWrapped = true
  538. IntroLabel.FontSize = "Size24"
  539. IntroLabel.TextColor3 = Color3.new(1, 1, 1)
  540. IntroLabel.BackgroundTransparency = 1
  541. IntroLabel.Text = "Welcome to Mortadex! Made By XpertGaming."
  542. IntroLabel.Parent = IntroWindow.Content
  543. IntroLabel.Size = UDim2.new(1, 0, 1, 0)
  544.  
  545. Mortadex:Log("Initialization complete!")-- MORTADEX
  546. -- WRITTEN BY LOUKA @ V3RMILLION
  547. -- DON'T JEW THE LOCALSCRIPT IF YOU DON'T KNOW HOW TO SCRIPT
  548.  
  549. local Mortadex = {}
  550. Mortadex.Version = "1"
  551. Mortadex.Modules = {}
  552. Mortadex.ModuleCount = 0
  553. Mortadex.ModuleSelection = 1
  554.  
  555. Mortadex.Stealth = true -- this will just remove print messages
  556. Mortadex.Debug = false
  557. Mortadex.FreeForAll = false
  558. Mortadex.Studio = false
  559.  
  560. function Mortadex:RegisterModule(name, onrender, norender)
  561. if Mortadex.Modules[name] then
  562. return error("Module \""..name.."\" already registered!")
  563. else
  564. Mortadex:FLog("Registering module \"%s\"", name)
  565. Mortadex.Modules[name] = {OnRender = onrender, NoRender = norender, Scratchpad = {}, Enabled = false, Order = Mortadex.ModuleCount}
  566. Mortadex.ModuleCount = Mortadex.ModuleCount + 1
  567. end
  568. end
  569.  
  570. function Mortadex:Log(...)
  571. if Mortadex.Stealth then return end
  572. return print("[- MORTADEX -] ", ...)
  573. end
  574.  
  575. function Mortadex:FLog(o, ...)
  576. return Mortadex:Log(o:format(...))
  577. end
  578.  
  579. local getrawmetatable = getrawmetatable
  580.  
  581. ---------------------------------------------------------------
  582.  
  583. Mortadex:Log("Loading core utilities...")
  584.  
  585. Mortadex.HookManager = {IdxHooks = {}, NIdxHooks = {}}
  586. Mortadex.Utilities = {}
  587. Mortadex.Services = {
  588. Players = game:GetService("Players"),
  589. Lighting = game:GetService("Lighting"),
  590. RunService = game:GetService("RunService"),
  591. UserInputService = game:GetService("UserInputService")
  592. }
  593. Mortadex.Instances = {
  594. LocalPlayer = Mortadex.Services.Players.LocalPlayer,
  595. LocalCharacter = Mortadex.Services.Players.LocalPlayer.Character,
  596. LocalCamera = workspace.CurrentCamera,
  597. LocalMouse = Mortadex.Services.Players.LocalPlayer:GetMouse()
  598. }
  599.  
  600. function Mortadex.HookManager:Init()
  601. if getrawmetatable then
  602. local ObjectMt = getrawmetatable(game)
  603. Mortadex.OriginalIndex = ObjectMt.__index
  604. Mortadex.OriginalNewIndex = ObjectMt.__newindex
  605.  
  606. ObjectMt.__index = function(self, key)
  607. local Hook = Mortadex.HookManager:LookupIndexHook(self, key)
  608. if Hook then
  609. return Hook(self)
  610. else
  611. return Mortadex.OriginalIndex(self, key)
  612. end
  613. end
  614.  
  615. ObjectMt.__newindex = function(self, key, value)
  616. local Hook = Mortadex.HookManager:LookupNewIndexHook(self, key)
  617. if Hook then
  618. return Hook(self, value)
  619. else
  620. return Mortadex.OriginalNewIndex(self, key, value)
  621. end
  622. end
  623.  
  624. return true
  625. end
  626. end
  627.  
  628. function Mortadex.HookManager:LookupIndexHook(inst, key)
  629. for _, Hook in next, Mortadex.HookManager.IdxHooks do
  630. if Mortadex.OriginalIndex(inst, "IsA")(inst, Hook.AffectedClass) and Hook.Property == key then
  631. return Hook.HookFunction
  632. end
  633. end
  634. end
  635.  
  636. function Mortadex.HookManager:LookupNewIndexHook(inst, key)
  637. for _, Hook in next, Mortadex.HookManager.NIdxHooks do
  638. if Mortadex.OriginalIndex(inst, "IsA")(inst, Hook.AffectedClass) and Hook.Property == key then
  639. return Hook.HookFunction
  640. end
  641. end
  642. end
  643.  
  644. function Mortadex.HookManager:HookIndex(class, prop, f)
  645. return table.insert(Mortadex.HookManager.IdxHooks, {AffectedClass = class, Property = prop, HookFunction = f})
  646. end
  647.  
  648. function Mortadex.HookManager:HookNewIndex(class, prop, f)
  649. return table.insert(Mortadex.HookManager.NIdxHooks, {AffectedClass = class, Property = prop, HookFunction = f})
  650. end
  651.  
  652. function Mortadex.Utilities:WorldToScreenPoint(...)
  653. return Mortadex.Instances.LocalCamera:WorldToScreenPoint(...)
  654. end
  655.  
  656. function Mortadex.Utilities:PathObstructed(p1, p2, ...)
  657. local ray = Ray.new(p1, (p2 - p1).unit * 500)
  658. local haspart, hitpos = workspace:FindPartOnRayWithIgnoreList(ray, {...})
  659. if haspart then return true, hitpos else return false end
  660. end
  661.  
  662. function Mortadex.Utilities:GetReplicator()
  663. return game:FindFirstChild("ClientReplicator", true)
  664. end
  665.  
  666. function Mortadex.Utilities:GetSize(i)
  667. if i:IsA("BasePart") then
  668. return i.Size
  669. elseif i:IsA("Model") then
  670. return i:GetExtentsSize()
  671. end
  672. end
  673.  
  674. function Mortadex.Utilities:GetPlayers(mode)
  675. local Result = {}
  676. for _,player in next, Mortadex.Services.Players:GetPlayers() do
  677. if mode == 0 then -- exclude players in current team
  678. if (player ~= Mortadex.Instances.LocalPlayer and (Mortadex.Instances.LocalPlayer.TeamColor ~= player.TeamColor or (FreeForAll or DEBUG))) then
  679. table.insert(Result, player)
  680. end
  681. else -- include everyone
  682. table.insert(Result, player)
  683. end
  684. end
  685. return Result
  686. end
  687.  
  688. function Mortadex.Utilities:GetNearestPlayer()
  689. if not Mortadex.Instances.LocalPlayer.Character then return end
  690. local Players = Mortadex.Utilities:GetPlayers(0)
  691. local SelectedPlayer, SelectedPlayerPrevDistance = nil, 25000
  692. for i,v in next, Players do
  693. if v.Character and v.Character:FindFirstChild("HumanoidRootPart") then
  694. local Distance = Mortadex.Utilities:GetDistance(Mortadex.Instances.LocalPlayer.Character.HumanoidRootPart.Position, v.Character.HumanoidRootPart.Position)
  695. if Distance < SelectedPlayerPrevDistance then
  696. SelectedPlayer = v
  697. SelectedPlayerPrevDistance = Distance
  698. end
  699. end
  700. end
  701. return SelectedPlayer
  702. end
  703.  
  704. function Mortadex.Utilities:GetDistance(v1, v2)
  705. return (v1 - v2).magnitude
  706. end
  707.  
  708. function Mortadex.Utilities:GetCanvas()
  709. if not Mortadex.Canvas then
  710. if getrawmetatable then
  711. Mortadex.Canvas = Instance.new("ScreenGui", game:GetService("CoreGui"))
  712. else
  713. Mortadex.Canvas = Instance.new("ScreenGui", Mortadex.Services.Players.LocalPlayer.PlayerGui)
  714. end
  715. end
  716. return Mortadex.Canvas
  717. end
  718.  
  719. Mortadex.EmptyVector3 = Vector3.new()
  720. Mortadex.EmptyCFrame = CFrame.new()
  721.  
  722. ---------------------------------------------------------------
  723.  
  724. --> ESP
  725. Mortadex:RegisterModule("ESP", function(Storage)
  726. local Canvas = Mortadex.Utilities:GetCanvas()
  727. local Root = Canvas:FindFirstChild("ESP")
  728. if not Root then
  729. Root = Instance.new("Frame")
  730. Root.Name = "ESP"
  731. Root.Size = UDim2.new(1, 0, 1, 0)
  732. Root.BackgroundTransparency = 1
  733. end
  734.  
  735. Root:ClearAllChildren()
  736. for _, Player in next, Mortadex.Utilities:GetPlayers(0) do
  737. if Player.Character and Player.Character:FindFirstChild("Torso") then
  738. local Locator = Instance.new("Frame")
  739. Locator.BackgroundColor = Player.TeamColor
  740. Locator.BackgroundTransparency = .5
  741. local VPos, VVis = Mortadex.Utilities:WorldToScreenPoint(Player.Character.Torso.Position)
  742. if VVis then
  743. Locator.Size = UDim2.new(0, -2800 / VPos.z, 0, -4300 / VPos.z)
  744. Locator.Position = UDim2.new(0, VPos.x - Locator.Size.X.Offset / 2, 0, VPos.y - Locator.Size.Y.Offset / 2)
  745. local Name = Instance.new("TextLabel")
  746. Name.TextColor3 = Color3.new(1,1,1)
  747. Name.Size = UDim2.new(1,0,0, Locator.Size.Y.Offset / 5)
  748. Name.BackgroundTransparency = 1
  749. Name.TextScaled = true
  750. Name.FontSize = 'Size24'
  751. Name.Text = Player.Name
  752. Name.TextStrokeTransparency = .3
  753. Name.Font = 'SourceSansLight'
  754. Name.TextXAlignment = 'Left'
  755. Name.Parent = Locator
  756. Locator.Parent = Root
  757. else
  758. Locator:Destroy()
  759. end
  760. end
  761. end
  762.  
  763. if not Root.Parent then
  764. Root.Parent = Canvas
  765. end
  766. end)
  767.  
  768. --> FreeForAll
  769. Mortadex:RegisterModule("FreeForAll", function(Storage)
  770. FreeForAll = true
  771. end, function(Storage) FreeForAll = false end)
  772.  
  773. --> Chams
  774. Mortadex:RegisterModule("Chams", function(Storage)
  775. for i, Cham in next, Storage do
  776. if Cham.Name:find("Cham") then
  777. Cham:Destroy()
  778. Storage[i] = nil
  779. end
  780. end
  781.  
  782. for _, Player in next, Mortadex.Utilities:GetPlayers(0) do
  783. if Player.Character and Player.Character:FindFirstChild("Torso") then
  784. for _, Part in next, Player.Character:GetChildren() do
  785. if Part:IsA("PVInstance") then
  786. local Box = Instance.new("BoxHandleAdornment")
  787. Box.Size = Mortadex.Utilities:GetSize(Part) + Vector3.new(.2, .2, .2)
  788. Box.Name = "Cham" .. Player.Name
  789. Box.Color3 = Player.TeamColor.Color
  790. Box.Adornee = Part
  791. Box.AlwaysOnTop = true
  792. Box.ZIndex = 5
  793. Box.Transparency = .1
  794. table.insert(Storage, Box)
  795. Box.Parent = Mortadex.Utilities:GetCanvas()
  796. end
  797. end
  798. end
  799. end
  800. end)
  801.  
  802. --> LagSwitch
  803. Mortadex:RegisterModule("LagSwitch", function(Storage)
  804. if not Storage.State then
  805. Storage.State = true
  806. local Replicator = Mortadex.Utilities:GetReplicator()
  807. if Replicator then
  808. Replicator:DisableProcessPackets()
  809. end
  810. end
  811. end,
  812.  
  813. function(Storage)
  814. if Storage.State then
  815. Storage.State = false
  816. local Replicator = Mortadex.Utilities:GetReplicator()
  817. if Replicator then
  818. Replicator:EnableProcessPackets()
  819. end
  820. end
  821. end)
  822.  
  823. --> IronSight
  824. Mortadex:RegisterModule("IronSight", function(Storage)
  825. local Sight = Instance.new("Frame")
  826. Sight.Size = UDim2.new(0, 5, 0, 5)
  827. Sight.BackgroundTransparency = .5
  828. Sight.BackgroundColor3 = Color3.new(1, 1, 1)
  829. Sight.Position = UDim2.new(0, Mortadex.Instances.LocalMouse.X, 0, Mortadex.Instances.LocalMouse.Y)
  830. Sight.Parent = Mortadex.Utilities:GetCanvas()
  831. end)
  832.  
  833. --> KnifeMaster
  834. Mortadex:RegisterModule("KnifeMaster", function(Storage)
  835. if not Mortadex.Instances.LocalPlayer.Character then
  836. return
  837. end
  838. local Pl = Mortadex.Utilities:GetNearestPlayer()
  839. if Pl and Pl.Character and Mortadex.Utilities:GetDistance(Pl.Character.Torso.Position, Mortadex.Instances.LocalPlayer.Character.HumanoidRootPart.Position) < 150 then
  840. Mortadex.Instances.LocalPlayer.Character.HumanoidRootPart.CFrame = Pl.Character.Torso.CFrame * CFrame.new(0,0,3)
  841. end
  842. end)
  843.  
  844. --> BigHead
  845. Mortadex:RegisterModule("BigHead", function(Storage)
  846. for _, v in next, Mortadex.Utilities:GetPlayers(0) do
  847. if v.Character then
  848. if not Storage[v.Name] then
  849. Storage[v.Name] = { v.Character.Head.Size, v.Character.Head.CFrame }
  850. end
  851. v.Character.Head.CanCollide = false
  852. v.Character.Head.Size = Vector3.new(40, 40, 40)
  853. v.Character.Head.CFrame = v.Character.Torso.CFrame * CFrame.new(0, 20, 0)
  854. v.Character.Head.Transparency = .3
  855. end
  856. end
  857. end,
  858.  
  859. function(Storage)
  860. if not Storage.NormalSize then
  861. Storage.NormalSize = Vector3.new(2, 1, 1)
  862. end
  863.  
  864. for _, v in next, Mortadex.Utilities:GetPlayers(0) do
  865. if v.Character then
  866. v.Character.Head.CanCollide = true
  867. v.Character.Head.Size = Storage.NormalSize
  868. end
  869. end
  870. end)
  871.  
  872. ---------------------------------------------------------------
  873.  
  874. Mortadex:Log("Loading UI...")
  875.  
  876. function Mortadex:CreateWindow(name, size, timed_close, tween)
  877. local TopBar = Instance.new("TextLabel")
  878. TopBar.Name = "NO_CLEAR"
  879. TopBar.Size = UDim2.new(size.X.Scale, size.X.Offset, 0, 20)
  880. TopBar.BorderSizePixel = 0
  881. TopBar.BackgroundColor3 = Color3.new(1, 0, 0)
  882. TopBar.Text = name
  883. TopBar.TextXAlignment = Enum.TextXAlignment.Left
  884. TopBar.TextScaled = true
  885. TopBar.Font = Enum.Font.Code
  886. TopBar.TextColor3 = Color3.new(0, 0, 0)
  887. TopBar.Position = UDim2.new(.5, -(size.X.Offset/2), .5, -(size.Y.Offset/2))
  888. TopBar.Draggable = true
  889. TopBar.Active = true
  890.  
  891. local Window = Instance.new("Frame")
  892. Window.Name = "Content"
  893. Window.Size = size
  894. Window.BackgroundColor3 = Color3.new(0, 0, 0)
  895. Window.Position = UDim2.new(0, 0, 0, 20)
  896. Window.BackgroundTransparency = .3
  897. Window.BorderSizePixel = 0
  898.  
  899. if not timed_close then
  900. local CloseBtn = Instance.new("TextButton", TopBar)
  901. CloseBtn.Position = UDim2.new(1, -20, 0, 0)
  902. CloseBtn.Size = UDim2.new(0, 20, 1, 0)
  903. CloseBtn.BorderSizePixel = 0
  904. CloseBtn.Name = "CloseBtn"
  905. CloseBtn.BackgroundColor3 = Color3.new(0,0,0)
  906. CloseBtn.TextColor3 = Color3.new(1, 0, 0)
  907. CloseBtn.Text = "X"
  908. CloseBtn.MouseButton1Click:connect(function()
  909. TopBar:Destroy()
  910. end)
  911. else
  912. local Countdown = Instance.new("TextLabel", TopBar)
  913. Countdown.Position = UDim2.new(1, -20, 0, 0)
  914. Countdown.Size = UDim2.new(0, 20, 1, 0)
  915. Countdown.BackgroundTransparency = 1
  916. Countdown.TextColor3 = Color3.new(0, 0, 0)
  917. Countdown.Text = tostring(timed_close)
  918. local BackPos
  919. if tween then
  920. BackPos = TopBar.Position
  921. TopBar.Position = UDim2.new(.5, -(size.X.Offset/2), 1, 0)
  922. end
  923. spawn(function()
  924. if tween then
  925. TopBar:TweenPosition(BackPos, "Out", "Quad", .3, true)
  926. end
  927. for i = timed_close-1, 0, -1 do
  928. wait(1)
  929. Countdown.Text = tostring(i)
  930. end
  931. if not tween then
  932. TopBar:Destroy()
  933. else
  934. TopBar:TweenPosition(UDim2.new(.5, -(size.X.Offset/2), 1, 0), "Out", "Sine", .3, true)
  935. wait(.3)
  936. TopBar:Destroy()
  937. end
  938. end)
  939. end
  940.  
  941. Window.Parent = TopBar
  942. TopBar.Parent = Mortadex.Utilities:GetCanvas()
  943. return TopBar
  944. end
  945.  
  946.  
  947. ---------------------------------------------------------------
  948.  
  949. if not script then script = Instance.new("LocalScript") end
  950. Mortadex.UpvalScript = script
  951.  
  952. Mortadex:Log("Hooking functions...")
  953. Mortadex.HookManager:Init()
  954. Mortadex.HookManager:HookIndex("Player", "Kick", error)
  955. Mortadex.HookManager:HookIndex("BasePart", "Size", function(Part)
  956. local caller_env = getfenv(1)
  957. if caller_env.script ~= Mortadex.UpvalScript and caller_env.script.ClassName ~= "CoreScript" then
  958. if Part.Name == "Head" then
  959. return Mortadex.EmptyVector3
  960. end
  961. end
  962. return Mortadex.OriginalIndex(Part, "Size")
  963. end)
  964.  
  965. Mortadex.HookManager:HookIndex("BasePart", "CFrame", function(Part)
  966. local caller_env = getfenv(1)
  967. if caller_env.script ~= Mortadex.UpvalScript and caller_env.script.ClassName ~= "CoreScript" then
  968. if Part.Name == "Head" then
  969. return Mortadex.EmptyCFrame
  970. end
  971. end
  972. return Mortadex.OriginalIndex(Part, "CFrame")
  973. end)
  974.  
  975. Mortadex.HookManager:HookIndex("BasePart", "Transparency", function(Part)
  976. local caller_env = getfenv(1)
  977. if caller_env.script ~= Mortadex.UpvalScript and caller_env.script.ClassName ~= "CoreScript" then
  978. if Part.Name == "Head" then
  979. return 0
  980. end
  981. end
  982. return Mortadex.OriginalIndex(Part, "Transparency")
  983. end)
  984.  
  985. Mortadex:Log("Creating menu...")
  986. Mortadex.SelectionMenu = Mortadex:CreateWindow("Mortadex v"..Mortadex.Version, UDim2.new(0, 250, 0, 20 * Mortadex.ModuleCount))
  987. Mortadex.SelectionMenu.Position = UDim2.new(0, 10, 0, 10)
  988. Mortadex.SelectionMenu.CloseBtn:Destroy()
  989.  
  990. for ModuleName, Module in next, Mortadex.Modules do
  991. local Entry = Instance.new("TextLabel")
  992. Entry.BackgroundTransparency = 1
  993. Entry.BackgroundColor3 = Color3.new(1,1,1)
  994. Entry.TextColor3 = Color3.new(1, 1, 1)
  995. Entry.TextScaled = true
  996. Entry.Font = "Code"
  997. Entry.TextXAlignment = "Left"
  998. Entry.Text = ModuleName
  999. Entry.Position = UDim2.new(0, 0, 0, 20 * Module.Order)
  1000. Entry.Size = UDim2.new(1, 0, 0, 20)
  1001. Entry.Name = tostring(Module.Order)
  1002. Entry.Parent = Mortadex.SelectionMenu.Content
  1003. Entry.BorderSizePixel = 0
  1004.  
  1005. local Status = Instance.new("Frame")
  1006. Status.BorderSizePixel = 0
  1007. Status.BackgroundColor3 = Color3.new(1, 0, 0)
  1008. Status.Size = UDim2.new(0, 5, 0, 5)
  1009. Status.Position = UDim2.new(1, -10, 0, 8)
  1010. Status.Name = "Status"
  1011. Status.Parent = Entry
  1012. end
  1013.  
  1014. Mortadex:Log("Connecting UI renderer...")
  1015. Mortadex.Services.RunService:BindToRenderStep("Mortadex", Enum.RenderPriority.Last.Value + 1, function()
  1016. for _, Object in next, Mortadex.Utilities:GetCanvas():GetChildren() do
  1017. if not Object.Name:find("NO_CLEAR") then
  1018. Object:Destroy()
  1019. end
  1020. end
  1021.  
  1022. for i, Module in next, Mortadex.Modules do
  1023. if Module.Enabled and Module.OnRender then
  1024. local Success, ErrMsg = pcall(Module.OnRender, Module.Scratchpad)
  1025. if not Success then
  1026. Mortadex:FLog("Panic during execution of \"%s\"::OnRender: %s", i, ErrMsg)
  1027. end
  1028. elseif not Module.Enabled and Module.NoRender then
  1029. local Success, ErrMsg = pcall(Module.NoRender, Module.Scratchpad)
  1030. if not Success then
  1031. Mortadex:FLog("Panic during execution of \"%s\"::NoRender: %s", i, ErrMsg)
  1032. end
  1033. end
  1034. end
  1035. end)
  1036.  
  1037. Mortadex:Log("Attaching controls...")
  1038. Mortadex.Services.UserInputService.InputBegan:connect(function(InputObject)
  1039. local PreviousSelection = Mortadex.SelectionMenu.Content:FindFirstChild(tostring(Mortadex.ModuleSelection))
  1040. if PreviousSelection then
  1041. PreviousSelection.BackgroundTransparency = 1
  1042. PreviousSelection.TextColor3 = Color3.new(1, 1, 1)
  1043. end
  1044. if InputObject.KeyCode.Name == "J" then
  1045. Mortadex.ModuleSelection = Mortadex.ModuleSelection - 1
  1046. if Mortadex.ModuleSelection < 0 then
  1047. Mortadex.ModuleSelection = Mortadex.ModuleCount - 1
  1048. end
  1049. elseif InputObject.KeyCode.Name == "K" then
  1050. Mortadex.ModuleSelection = Mortadex.ModuleSelection + 1
  1051. if Mortadex.ModuleSelection > Mortadex.ModuleCount-1 then
  1052. Mortadex.ModuleSelection = 0
  1053. end
  1054. elseif InputObject.KeyCode.Name == "L" then
  1055. local EntryLabel = Mortadex.SelectionMenu.Content:FindFirstChild(tostring(Mortadex.ModuleSelection))
  1056. if EntryLabel then
  1057. local ModuleEntry = Mortadex.Modules[EntryLabel.Text]
  1058. if ModuleEntry then
  1059. ModuleEntry.Enabled = not ModuleEntry.Enabled
  1060. if ModuleEntry.Enabled then
  1061. EntryLabel.Status.BackgroundColor3 = Color3.new(0, 1, 0)
  1062. else
  1063. EntryLabel.Status.BackgroundColor3 = Color3.new(1, 0, 0)
  1064. end
  1065. end
  1066. end
  1067. elseif InputObject.KeyCode.Name == "P" then
  1068. Mortadex.SelectionMenu.Position = UDim2.new(1, -270, 0, 10)
  1069. end
  1070. local EntryLabel = Mortadex.SelectionMenu.Content:FindFirstChild(tostring(Mortadex.ModuleSelection))
  1071. if EntryLabel then
  1072. EntryLabel.BackgroundTransparency = .3
  1073. EntryLabel.TextColor3 = Color3.new(0, 0, 0)
  1074. end
  1075. end)
  1076.  
  1077. Mortadex:Log("Finishing up...")
  1078. local IntroWindow = Mortadex:CreateWindow("Mortadex", UDim2.new(0, 350, 0, 200), 5, true)
  1079. local IntroLabel = Instance.new("TextLabel")
  1080. IntroLabel.Font = "Code"
  1081. IntroLabel.TextWrapped = true
  1082. IntroLabel.FontSize = "Size24"
  1083. IntroLabel.TextColor3 = Color3.new(1, 1, 1)
  1084. IntroLabel.BackgroundTransparency = 1
  1085. IntroLabel.Text = "Welcome to Mortadex! Made By XpertGaming."
  1086. IntroLabel.Parent = IntroWindow.Content
  1087. IntroLabel.Size = UDim2.new(1, 0, 1, 0)
  1088.  
  1089. Mortadex:Log("Initialization complete!")
Advertisement
Add Comment
Please, Sign In to add comment