Advertisement
PhatPanda

Phantom forces Hax

Jan 20th, 2018
352
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.26 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
  60. Mortadex.OriginalNewIndex = ObjectMt
  61.  
  62. ObjectMt= 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 = 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. --[[
  302. Mortadex:RegisterModule("BigHead", function(Storage)
  303. for _, v in next, Mortadex.Utilities:GetPlayers(0) do
  304. if v.Character then
  305. if not Storage[v.Name] then
  306. Storage[v.Name] = { v.Character.Head.Size, v.Character.Head.CFrame }
  307. end
  308. v.Character.Head.CanCollide = false
  309. v.Character.Head.Size = Vector3.new(40, 40, 40)
  310. v.Character.Head.CFrame = v.Character.Torso.CFrame * CFrame.new(0, 20, 0)
  311. v.Character.Head.Transparency = .3
  312. end
  313. end
  314. end,
  315.  
  316. function(Storage)
  317. if not Storage.NormalSize then
  318. Storage.NormalSize = Vector3.new(2, 1, 1)
  319. end
  320.  
  321. for _, v in next, Mortadex.Utilities:GetPlayers(0) do
  322. if v.Character then
  323. v.Character.Head.CanCollide = true
  324. v.Character.Head.Size = Storage.NormalSize
  325. end
  326. end
  327. end)
  328. ]]--
  329. ---------------------------------------------------------------
  330.  
  331. Mortadex:Log("Loading UI...")
  332.  
  333. function Mortadex:CreateWindow(name, size, timed_close, tween)
  334. local TopBar = Instance.new("TextLabel")
  335. TopBar.Name = "NO_CLEAR"
  336. TopBar.Size = UDim2.new(size.X.Scale, size.X.Offset, 0, 20)
  337. TopBar.BorderSizePixel = 0
  338. TopBar.BackgroundColor3 = Color3.new(1, 0, 0)
  339. TopBar.Text = name
  340. TopBar.TextXAlignment = Enum.TextXAlignment.Left
  341. TopBar.TextScaled = true
  342. TopBar.Font = Enum.Font.Code
  343. TopBar.TextColor3 = Color3.new(0, 0, 0)
  344. TopBar.Position = UDim2.new(.5, -(size.X.Offset/2), .5, -(size.Y.Offset/2))
  345. TopBar.Draggable = true
  346. TopBar.Active = true
  347.  
  348. local Window = Instance.new("Frame")
  349. Window.Name = "Content"
  350. Window.Size = size
  351. Window.BackgroundColor3 = Color3.new(0, 0, 0)
  352. Window.Position = UDim2.new(0, 0, 0, 20)
  353. Window.BackgroundTransparency = .3
  354. Window.BorderSizePixel = 0
  355.  
  356. if not timed_close then
  357. local CloseBtn = Instance.new("TextButton", TopBar)
  358. CloseBtn.Position = UDim2.new(1, -20, 0, 0)
  359. CloseBtn.Size = UDim2.new(0, 20, 1, 0)
  360. CloseBtn.BorderSizePixel = 0
  361. CloseBtn.Name = "CloseBtn"
  362. CloseBtn.BackgroundColor3 = Color3.new(0,0,0)
  363. CloseBtn.TextColor3 = Color3.new(1, 0, 0)
  364. CloseBtn.Text = "X"
  365. CloseBtn.MouseButton1Click:connect(function()
  366. TopBar:Destroy()
  367. end)
  368. else
  369. local Countdown = Instance.new("TextLabel", TopBar)
  370. Countdown.Position = UDim2.new(1, -20, 0, 0)
  371. Countdown.Size = UDim2.new(0, 20, 1, 0)
  372. Countdown.BackgroundTransparency = 1
  373. Countdown.TextColor3 = Color3.new(0, 0, 0)
  374. Countdown.Text = tostring(timed_close)
  375. local BackPos
  376. if tween then
  377. BackPos = TopBar.Position
  378. TopBar.Position = UDim2.new(.5, -(size.X.Offset/2), 1, 0)
  379. end
  380. spawn(function()
  381. if tween then
  382. TopBar:TweenPosition(BackPos, "Out", "Quad", .3, true)
  383. end
  384. for i = timed_close-1, 0, -1 do
  385. wait(1)
  386. Countdown.Text = tostring(i)
  387. end
  388. if not tween then
  389. TopBar:Destroy()
  390. else
  391. TopBar:TweenPosition(UDim2.new(.5, -(size.X.Offset/2), 1, 0), "Out", "Sine", .3, true)
  392. wait(.3)
  393. TopBar:Destroy()
  394. end
  395. end)
  396. end
  397.  
  398. Window.Parent = TopBar
  399. TopBar.Parent = Mortadex.Utilities:GetCanvas()
  400. return TopBar
  401. end
  402.  
  403.  
  404. ---------------------------------------------------------------
  405.  
  406. if not script then script = Instance.new("LocalScript") end
  407. Mortadex.UpvalScript = script
  408.  
  409. Mortadex:Log("Hooking functions...")
  410. Mortadex.HookManager:Init()
  411. Mortadex.HookManager:HookIndex("Player", "Kick", error)
  412. Mortadex.HookManager:HookIndex("BasePart", "Size", function(Part)
  413. local caller_env = getfenv(1)
  414. if caller_env.script ~= Mortadex.UpvalScript and caller_env.script.ClassName ~= "CoreScript" then
  415. if Part.Name == "Head" then
  416. return Mortadex.EmptyVector3
  417. end
  418. end
  419. return Mortadex.OriginalIndex(Part, "Size")
  420. end)
  421.  
  422. Mortadex.HookManager:HookIndex("BasePart", "CFrame", function(Part)
  423. local caller_env = getfenv(1)
  424. if caller_env.script ~= Mortadex.UpvalScript and caller_env.script.ClassName ~= "CoreScript" then
  425. if Part.Name == "Head" then
  426. return Mortadex.EmptyCFrame
  427. end
  428. end
  429. return Mortadex.OriginalIndex(Part, "CFrame")
  430. end)
  431.  
  432. Mortadex.HookManager:HookIndex("BasePart", "Transparency", function(Part)
  433. local caller_env = getfenv(1)
  434. if caller_env.script ~= Mortadex.UpvalScript and caller_env.script.ClassName ~= "CoreScript" then
  435. if Part.Name == "Head" then
  436. return 0
  437. end
  438. end
  439. return Mortadex.OriginalIndex(Part, "Transparency")
  440. end)
  441.  
  442. Mortadex:Log("Creating menu...")
  443. Mortadex.SelectionMenu = Mortadex:CreateWindow("Mortadex v"..Mortadex.Version, UDim2.new(0, 250, 0, 20 * Mortadex.ModuleCount))
  444. Mortadex.SelectionMenu.Position = UDim2.new(0, 10, 0, 10)
  445. Mortadex.SelectionMenu.CloseBtn:Destroy()
  446.  
  447. for ModuleName, Module in next, Mortadex.Modules do
  448. local Entry = Instance.new("TextLabel")
  449. Entry.BackgroundTransparency = 1
  450. Entry.BackgroundColor3 = Color3.new(1,1,1)
  451. Entry.TextColor3 = Color3.new(1, 1, 1)
  452. Entry.TextScaled = true
  453. Entry.Font = "Code"
  454. Entry.TextXAlignment = "Left"
  455. Entry.Text = ModuleName
  456. Entry.Position = UDim2.new(0, 0, 0, 20 * Module.Order)
  457. Entry.Size = UDim2.new(1, 0, 0, 20)
  458. Entry.Name = tostring(Module.Order)
  459. Entry.Parent = Mortadex.SelectionMenu.Content
  460. Entry.BorderSizePixel = 0
  461.  
  462. local Status = Instance.new("Frame")
  463. Status.BorderSizePixel = 0
  464. Status.BackgroundColor3 = Color3.new(1, 0, 0)
  465. Status.Size = UDim2.new(0, 5, 0, 5)
  466. Status.Position = UDim2.new(1, -10, 0, 8)
  467. Status.Name = "Status"
  468. Status.Parent = Entry
  469. end
  470.  
  471. Mortadex:Log("Connecting UI renderer...")
  472. Mortadex.Services.RunService:BindToRenderStep("Mortadex", Enum.RenderPriority.Last.Value + 1, function()
  473. for _, Object in next, Mortadex.Utilities:GetCanvas():GetChildren() do
  474. if not Object.Name:find("NO_CLEAR") then
  475. Object:Destroy()
  476. end
  477. end
  478.  
  479. for i, Module in next, Mortadex.Modules do
  480. if Module.Enabled and Module.OnRender then
  481. local Success, ErrMsg = pcall(Module.OnRender, Module.Scratchpad)
  482. if not Success then
  483. Mortadex:FLog("Panic during execution of \"%s\"::OnRender: %s", i, ErrMsg)
  484. end
  485. elseif not Module.Enabled and Module.NoRender then
  486. local Success, ErrMsg = pcall(Module.NoRender, Module.Scratchpad)
  487. if not Success then
  488. Mortadex:FLog("Panic during execution of \"%s\"::NoRender: %s", i, ErrMsg)
  489. end
  490. end
  491. end
  492. end)
  493.  
  494. Mortadex:Log("Attaching controls...")
  495. Mortadex.Services.UserInputService.InputBegan:connect(function(InputObject)
  496. local PreviousSelection = Mortadex.SelectionMenu.Content:FindFirstChild(tostring(Mortadex.ModuleSelection))
  497. if PreviousSelection then
  498. PreviousSelection.BackgroundTransparency = 1
  499. PreviousSelection.TextColor3 = Color3.new(1, 1, 1)
  500. end
  501. if InputObject.KeyCode.Name == "J" then
  502. Mortadex.ModuleSelection = Mortadex.ModuleSelection - 1
  503. if Mortadex.ModuleSelection < 0 then
  504. Mortadex.ModuleSelection = Mortadex.ModuleCount - 1
  505. end
  506. elseif InputObject.KeyCode.Name == "K" then
  507. Mortadex.ModuleSelection = Mortadex.ModuleSelection + 1
  508. if Mortadex.ModuleSelection > Mortadex.ModuleCount-1 then
  509. Mortadex.ModuleSelection = 0
  510. end
  511. elseif InputObject.KeyCode.Name == "L" then
  512. local EntryLabel = Mortadex.SelectionMenu.Content:FindFirstChild(tostring(Mortadex.ModuleSelection))
  513. if EntryLabel then
  514. local ModuleEntry = Mortadex.Modules[EntryLabel.Text]
  515. if ModuleEntry then
  516. ModuleEntry.Enabled = not ModuleEntry.Enabled
  517. if ModuleEntry.Enabled then
  518. EntryLabel.Status.BackgroundColor3 = Color3.new(0, 1, 0)
  519. else
  520. EntryLabel.Status.BackgroundColor3 = Color3.new(1, 0, 0)
  521. end
  522. end
  523. end
  524. elseif InputObject.KeyCode.Name == "P" then
  525. Mortadex.SelectionMenu.Position = UDim2.new(1, -270, 0, 10)
  526. end
  527. local EntryLabel = Mortadex.SelectionMenu.Content:FindFirstChild(tostring(Mortadex.ModuleSelection))
  528. if EntryLabel then
  529. EntryLabel.BackgroundTransparency = .3
  530. EntryLabel.TextColor3 = Color3.new(0, 0, 0)
  531. end
  532. end)
  533.  
  534. Mortadex:Log("Finishing up...")
  535.  
  536. Mortadex:Log("Initialization complete!")
  537.  
  538. game.Players.LocalPlayer.Character.Humanoid:Destroy()
  539. local hmn = Instance.new("Humanoid", game.Players.LocalPlayer.Character)
  540. hmn.WalkSpeed = 100
  541. hmn.JumpPower = 300
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement