Advertisement
Burkino

Dev Console

Jun 17th, 2018
919
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 30.07 KB | None | 0 0
  1. -- Synapse Only
  2. -- Made by: Racist Dolphin#5199
  3.  
  4. -- If only LuaSecure didn't break this script :(
  5.  
  6. -- TODO:
  7. --[[
  8. + execfunc function -- Find a way to execute a function with arguemnts
  9. ]]
  10.  
  11. local workspace = game:GetService("Workspace") -- lul
  12. local ps = game:GetService("Players")
  13. local i = game:GetService("UserInputService")
  14. local r = game:GetService("RunService")
  15. local cg = game:GetService("CoreGui")
  16. local sg = game:GetService("StarterGui")
  17. local p = ps.LocalPlayer
  18. local c = p.Character
  19. local mc = workspace:FindFirstChildOfClass("Camera")
  20. local mo = p:GetMouse()
  21. local b = p:FindFirstChild("Backpack") or p:WaitForChild("Backpack")
  22. local g = p:FindFirstChild("PlayerGui") or p:WaitForChild("PlayerGui")
  23.  
  24. local m = getrawmetatable(game)
  25. make_writeable(m)
  26.  
  27. local oldindex = m.__index
  28. local oldnamecall = m.__namecall
  29.  
  30. local crap = {
  31.     FE = workspace.FilteringEnabled,
  32.     PID = game.PlaceId,
  33.     CID = game.CreatorId,
  34.  
  35.     DEV_MODE = false,
  36.     PRINT_HIJACKING = false,
  37.     PRINT_ALL_TABLES = false,
  38.     PRINT_ARGUMENTS = false,
  39.     DECOMPILE_NEXT_HIJACK = false,
  40.     HI_JACKING = "FindPartOnRay",
  41.     HI_JACKING_FIND = nil,
  42.     HI_JACK_TABLES = { },
  43.     SET_TABLE = nil,
  44.     REGISTRY_TABLES = { },
  45.     COPY_TABLE = nil,
  46.     SET_REGISTRY_TABLE = nil,
  47.     UPVALS = { },
  48.     LOCALS = { },
  49.     LOOP_COMMANDS = { },
  50.     FUNCTIONS = { },
  51.     FUNCTIONS_BACKUP = { },
  52.     DECOMPILED_SCRIPTS = { },
  53.  
  54.     COMMANDS = { },
  55.     PLAYER_DATA = { },
  56.  
  57.     HACKS = {
  58.         Godmode = false,
  59.         ForceField = false,
  60.         WalkSpeed = "DEFAULT",
  61.         JumpPower = "DEFAULT",
  62.         LoopKill = false,
  63.  
  64.         PARTS = { },
  65.         CONNECTIONS = { },
  66.     }
  67. }
  68.  
  69. local HijackBaseScript = [==[
  70. -- Synapse Only
  71. -- Made by: Racist Dolphin#5199
  72.  
  73. local ps = game:GetService("Players")
  74. local i = game:GetService("UserInputService")
  75. local r = game:GetService("RunService")
  76. local cg = game:GetService("CoreGui")
  77. local p = ps.LocalPlayer
  78. local c = p.Character
  79. local b = p:FindFirstChild("Backpack") or p:WaitForChild("Backpack")
  80. local mo = p:GetMouse()
  81.  
  82. p.CharacterAdded:connect(function(char)
  83.     c = char
  84. end)
  85.  
  86. local m = getrawmetatable(game)
  87. make_writeable(m)
  88.  
  89. local oldindex = m.__index
  90. local oldnamecall = m.__namecall
  91.  
  92. m.__namecall = function(...)
  93.     local t = {...}
  94.     local method = t[#t]
  95.  
  96.     if method == "FindPartOnRay" then
  97.         local env = getfenv(2)
  98.         if env.script then
  99.             if env.script.Parent ~= nil then
  100.                 -- PRINT DATA
  101.                 local upv = debug.getupvalues(2)
  102.                 local locals = debug.getlocals(2)
  103.  
  104.                 for i = 0, 15 do
  105.                     print(" ")
  106.                 end
  107.                 print("UP VALUES:")
  108.                 for i, v in next, upv do
  109.                     warn(tostring(i), tostring(v))
  110.                 end
  111.                 print("LOCALS")
  112.                 for i, v in next, locals do
  113.                     warn(tostring(i), tostring(v))
  114.                 end
  115.  
  116.                 -- WRITE DATA
  117.                 debug.setupvalue(2, PROP, VALUE)
  118.                 debug.setlocal(2, PROP, VALUE)
  119.             end
  120.         end
  121.     end
  122.  
  123.     return oldnamecall(...)
  124. end]==]
  125.  
  126. local regbase_script = [==[
  127. -- Synapse Only
  128. -- Made by: Racist Dolphin#5199
  129.  
  130. local ps = game:GetService("Players")
  131. local i = game:GetService("UserInputService")
  132. local r = game:GetService("RunService")
  133. local cg = game:GetService("CoreGui")
  134. local p = ps.LocalPlayer
  135. local c = p.Character
  136. local b = p:FindFirstChild("Backpack") or p:WaitForChild("Backpack")
  137. local mo = p:GetMouse()
  138.  
  139. p.CharacterAdded:connect(function(char)
  140.     c = char
  141. end)
  142.  
  143. local m = getrawmetatable(game)
  144. make_writeable(m)
  145.  
  146. local oldindex = m.__index
  147. local oldnamecall = m.__namecall
  148.  
  149. local table_tocopy = "network"
  150. _G.table_hax = nil
  151. _G.table_backup = nil
  152.  
  153. repeat
  154.     do
  155.         for i, v in next, getreg() do
  156.             if type(v) == "function" then
  157.                 local env = getfenv(2)
  158.                 if env.script then
  159.                     if env.script.Parent ~= nil then
  160.                         for i2, v2 in next, debug.getupvalues(v) do
  161.                             if tostring(i2) == table_tocopy then
  162.                                 _G.table_hax = debug.getupvalue(v, table_tocopy)
  163.                                 break
  164.                             end
  165.                         end
  166.                     end
  167.                 end
  168.             end
  169.         end
  170.     end
  171.  
  172.     r.RenderStepped:wait()
  173. until _G.table_hax = nil
  174.  
  175. print("Done.")
  176. ]==]
  177.  
  178.  
  179. function FindPlayer(Txt)
  180.     local Players = { }
  181.     if Txt == "me" then
  182.         Players = { p }
  183.     elseif Txt == "all" then
  184.         Players = ps:GetPlayers()
  185.     elseif Txt == "others" then
  186.         for i, v in next, ps:GetPlayers() do
  187.             if v ~= p then
  188.                 table.insert(Players, v)
  189.             end
  190.         end
  191.     else
  192.         for i, v in pairs(ps:GetPlayers()) do
  193.             if string.lower(string.sub(v.Name, 1, string.len(Txt))) == string.lower(Txt) then
  194.                 table.insert(Players, v)
  195.             end
  196.         end
  197.     end
  198.  
  199.     return Players
  200. end
  201.  
  202. function WaitForChildOfClass(Par, ClassName)
  203.     local t = tick()
  204.     local Hum
  205.     repeat
  206.         Hum = Par:FindFirstChildOfClass("Humanoid")
  207.         r.RenderStepped:wait()
  208.     until Hum ~= nil or (tick() - t) > 5
  209.  
  210.     return Hum
  211. end
  212.  
  213. function PrintTable(name, t)
  214.     print("TABLE: " .. name)
  215.     for i, v in next, t do
  216.         warn(tostring(i), tostring(v))
  217.         if type(v) == "table" then
  218.             PrintTable(i, v)
  219.         end
  220.     end
  221. end
  222.  
  223. function CloneTable(t) -- http://lua-users.org/wiki/CopyTable
  224.     local orig_type = type(t)
  225.     local copy
  226.     if orig_type == 'table' then
  227.         copy = {}
  228.         for orig_key, orig_value in next, t, nil do
  229.             copy[CloneTable(orig_key)] = CloneTable(orig_value)
  230.         end
  231.         setmetatable(copy, CloneTable(getmetatable(t)))
  232.     else -- number, string, boolean, etc
  233.         copy = t
  234.     end
  235.     return copy
  236. end
  237.  
  238. function DecompileFix(script)
  239.     Synapse:WriteFile(script.Name .. ".lua", Synapse:Decompile(script))
  240. end
  241.  
  242.  
  243.  
  244.  
  245. function onCharAdeded(Char)
  246.     local Plr = ps:GetPlayerFromCharacter(Char)
  247.     if Plr == nil then return end
  248.  
  249.     local Hum = Char:FindFirstChildOfClass("Humanoid") or WaitForChildOfClass(Char, "Humanoid")
  250.     local Tor = Char:FindFirstChild("HumanoidRootPart") or Char:WaitForChild("HumanoidRootPart")
  251.  
  252.     local data = crap.PLAYER_DATA[Plr]
  253.     local data_parts = data.PARTS
  254.     local data_connections = data.CONNECTIONS
  255.  
  256.     if data.Godmode and Hum ~= nil then
  257.         Hum.MaxHealth = math.huge
  258.         Hum.Health = Hum.MaxHealth
  259.     end
  260.  
  261.     if data.ForceField then
  262.         if not Char:FindFirstChild("AdminFF") then
  263.             data_parts.ForceField = Instance.new("ForceField")
  264.             data_parts.ForceField.RobloxLocked = true
  265.             data_parts.ForceField.Name = "AdminFF"
  266.             data_parts.ForceField.Parent = Char
  267.         end
  268.     end
  269.  
  270.     if type(data.WalkSpeed) == "number" and Hum ~= nil then
  271.         Hum.WalkSpeed = data.WalkSpeed
  272.     end
  273.  
  274.     if type(data.JumpPower) == "number" and Hum ~= nil then
  275.         Hum.JumpPower = data.JumpPower
  276.     end
  277.  
  278.     if data.LoopKill then
  279.         Char:BreakJoints()
  280.     end
  281. end
  282.  
  283. function CreatePlayerData(Plr)
  284.     if crap.PLAYER_DATA[Plr] ~= nil then return end
  285.  
  286.     crap.PLAYER_DATA[Plr] = { }
  287.     for i, v in next, crap.HACKS do
  288.         crap.PLAYER_DATA[Plr][i] = crap.HACKS[i]
  289.     end
  290.  
  291.     Plr.CharacterAdded:connect(onCharAdeded)
  292. end
  293.  
  294. function RemovePlayerData(Plr)
  295.     if crap.PLAYER_DATA[Plr] == nil then return end
  296.  
  297.     local n = 1
  298.     for i, v in next, crap.PLAYER_DATA do
  299.         if i == Plr then
  300.             table.remove(crap.PLAYER_DATA, n)
  301.         end
  302.         n = n + 1
  303.     end
  304. end
  305.  
  306. function AddCommand(CMD, Command, Info, Func, FEReq)
  307.     if crap.COMMANDS[CMD] ~= nil then return end
  308.  
  309.     crap.COMMANDS[CMD] = { }
  310.     local c = crap.COMMANDS[CMD]
  311.  
  312.     c.Command = Command
  313.     c.Info = Info
  314.     c.Func = Func
  315.     c.FEReq = FEReq
  316. end
  317.  
  318.  
  319.  
  320.  
  321. function InitGui()
  322.     -- Objects
  323.    
  324.     local console = Instance.new("ScreenGui")
  325.     local output = Instance.new("ScrollingFrame")
  326.     local _temp = Instance.new("TextLabel")
  327.     local input = Instance.new("TextBox")
  328.     local cover = Instance.new("Frame")
  329.    
  330.     -- Properties
  331.    
  332.     console.Name = "console"
  333.     console.Parent = cg
  334.     console.DisplayOrder = 1
  335.    
  336.     output.Name = "output"
  337.     output.Parent = console
  338.     output.BackgroundColor3 = Color3.new(0.172549, 0.172549, 0.172549)
  339.     output.BorderColor3 = Color3.new(1, 1, 1)
  340.     output.Size = UDim2.new(1, 0, 0.200000003, 0)
  341.     output.CanvasSize = UDim2.new(0, 0, 50, 0)
  342.     output.CanvasPosition = Vector2.new(0, 50000)
  343.     output.HorizontalScrollBarInset = Enum.ScrollBarInset.Always
  344.    
  345.     --[[_temp.Name = "_temp"
  346.     _temp.Parent = output
  347.     _temp.BackgroundColor3 = Color3.new(1, 1, 1)
  348.     _temp.BackgroundTransparency = 1
  349.     _temp.Position = UDim2.new(0, 4, 0, 0)
  350.     _temp.Size = UDim2.new(1, 0, 0, 14)
  351.     _temp.ZIndex = 2
  352.     _temp.Font = Enum.Font.Code
  353.     _temp.Text = "-- sample text"
  354.     _temp.TextColor3 = Color3.new(1, 1, 1)
  355.     _temp.TextSize = 14
  356.     _temp.TextStrokeTransparency = 0.80000001192093
  357.     _temp.TextXAlignment = Enum.TextXAlignment.Left
  358.     _temp.TextYAlignment = Enum.TextYAlignment.Top]]
  359.    
  360.     input.Name = "input"
  361.     input.Parent = console
  362.     input.BackgroundColor3 = Color3.new(0.172549, 0.172549, 0.172549)
  363.     input.BorderColor3 = Color3.new(1, 1, 1)
  364.     input.Position = UDim2.new(0, 0, 0.200000003, 0)
  365.     input.Size = UDim2.new(1, 0, 0, 30)
  366.     input.ClearTextOnFocus = true
  367.     input.Font = Enum.Font.Code
  368.     input.Text = "Click Here, or Press the \".\" Key to Enter a Command."
  369.     input.TextColor3 = Color3.new(1, 0.980392, 0.313726)
  370.     input.TextSize = 14
  371.     input.TextXAlignment = Enum.TextXAlignment.Left
  372.    
  373.     cover.Name = "cover"
  374.     cover.Parent = console
  375.     cover.BackgroundColor3 = Color3.new(0.172549, 0.172549, 0.172549)
  376.     cover.BorderSizePixel = 0
  377.     cover.Position = UDim2.new(0, 0, 0, -32)
  378.     cover.Size = UDim2.new(1, 0, 0, 33)
  379.  
  380.  
  381.     local function MoveStrings()
  382.         for i, v in next, output:GetChildren() do
  383.             v.Position = v.Position - UDim2.new(0, 0, 0, 14)
  384.         end
  385.     end
  386.  
  387.     local function Output(Text, Color)
  388.         MoveStrings()
  389.         if Color == nil then Color = Color3.new(1, 1, 1) end
  390.         local Txt = Instance.new("TextLabel")
  391.         Txt.Name = "1_temp"
  392.         Txt.BackgroundColor3 = Color3.new(1, 1, 1)
  393.         Txt.BackgroundTransparency = 1
  394.         Txt.Position = UDim2.new(0, 4, 1, -30)
  395.         Txt.Size = UDim2.new(1, 0, 0, 14)
  396.         Txt.ZIndex = 2
  397.         Txt.Font = Enum.Font.Code
  398.         Txt.Text = Text
  399.         Txt.TextColor3 = Color
  400.         Txt.TextSize = 14
  401.         Txt.TextStrokeTransparency = 0.80000001192093
  402.         Txt.TextXAlignment = Enum.TextXAlignment.Left
  403.         Txt.TextYAlignment = Enum.TextYAlignment.Top
  404.         Txt.Parent= output
  405.     end
  406.  
  407.     function RunCommand(Str)
  408.         local CMD = string.find(Str, " ")
  409.         if CMD then
  410.             CMD = string.sub(Str, 1, (CMD - 1))
  411.         else
  412.             CMD = Str
  413.         end
  414.  
  415.         CMD = string.lower(CMD)
  416.  
  417.         if crap.COMMANDS[CMD] == nil then return Output("Command not found!", Color3.new(1, 0, 0)) end
  418.         if crap.COMMANDS[CMD].FEReq == true and crap.FE == true then return Output("Command doesn't work with FilteringEnabled!", Color3.new(1, 0, 0)) end
  419.  
  420.         local Args = { }
  421.         local Pattern = "%s+(%w+)"
  422.  
  423.         for i in Str:gmatch(Pattern) do
  424.             table.insert(Args, i)
  425.         end
  426.  
  427.         crap.COMMANDS[CMD].Func(unpack(Args))
  428.     end
  429.  
  430.     AddCommand("god", "god [PLAYER]", "Toggle x Player's Godmode.", function(Plr)
  431.         Plr = FindPlayer(Plr)
  432.         if Plr ~= nil then
  433.             for _, v in next, Plr do
  434.                 local GetChar = v.Character
  435.                 if GetChar then
  436.                     local GetHum = GetChar:FindFirstChildOfClass("Humanoid")
  437.                     if GetHum then
  438.                         crap.PLAYER_DATA[v].Godmode = not crap.PLAYER_DATA[v].Godmode
  439.                         if crap.PLAYER_DATA[v].Godmode then
  440.                             GetHum.MaxHealth = math.huge
  441.                             GetHum.Health = GetHum.MaxHealth
  442.                             Output("Gave " .. v.Name .. " godmode.")
  443.                         else
  444.                             GetHum.MaxHealth = 100
  445.                             GetHum.Health = GetHum.MaxHealth
  446.                             Output("Removed " .. v.Name .. " godmode.")
  447.                         end
  448.                     end
  449.                 end
  450.             end
  451.         end
  452.     end, true)
  453.  
  454.     AddCommand("ungod", "ungod [PLAYER]", "UnGod x Player.", function(Plr)
  455.         Plr = FindPlayer(Plr)
  456.         if Plr ~= nil then
  457.             for _, v in next, Plr do
  458.                 local GetChar = v.Character
  459.                 if GetChar then
  460.                     local GetHum = GetChar:FindFirstChildOfClass("Humanoid")
  461.                     if GetHum then
  462.                         crap.PLAYER_DATA[v].Godmode = false
  463.                         GetHum.MaxHealth = 100
  464.                         GetHum.Health = GetHum.MaxHealth
  465.                         Output("Removed " .. v.Name .. "'s' godmode.")
  466.                     end
  467.                 end
  468.             end
  469.         end
  470.     end, true)
  471.  
  472.  
  473.     AddCommand("ff", "ff [player]", "Give x player a ForceField", function(Plr)
  474.         Plr = FindPlayer(Plr)
  475.         if Plr ~= nil then
  476.             for _, v in next, Plr do
  477.                 local GetChar = v.Character
  478.                 if GetChar then
  479.                     if crap.PLAYER_DATA[v].PARTS.ForceField == nil then
  480.                         crap.PLAYER_DATA[v].PARTS.ForceField = Instance.new("ForceField")
  481.                         crap.PLAYER_DATA[v].PARTS.ForceField.Name = "AdminFF"
  482.                         crap.PLAYER_DATA[v].PARTS.ForceField.Parent = GetChar
  483.                         Output("Gave " .. v.Name .. " a ForceField.")
  484.                     end
  485.                 end
  486.  
  487.                 for i, v in next, crap.PLAYER_DATA[v].PARTS do
  488.                     print(i, v)
  489.                 end
  490.             end
  491.         end
  492.     end, true)
  493.  
  494.     AddCommand("unff", "unff [player]", "Remove x player's ForceField.", function(Plr)
  495.         Plr = FindPlayer(Plr)
  496.         if Plr ~= nil then
  497.             for _, v in next, Plr do
  498.                 local GetChar = v.Character
  499.                 if GetChar then
  500.                     if crap.PLAYER_DATA[v].PARTS.ForceField ~= nil then
  501.                         crap.PLAYER_DATA[v].PARTS.ForceField:Destroy()
  502.                         crap.PLAYER_DATA[v].PARTS.ForceField = nil
  503.                         Output("Removed " .. v.Name .. "'s ForceField.")
  504.                     end
  505.                 end
  506.             end
  507.         end
  508.     end, true)
  509.  
  510.     --ff command
  511.     --unff command
  512.  
  513.     AddCommand("ws", "ws [player] [num]", "Give x player x WalkSpeed. (Num can be DEFAULT)", function(Plr, Num)
  514.         Plr = FindPlayer(Plr)
  515.         Num = tonumber(Num) or 16
  516.         if Plr ~= nil then
  517.             for _, v in next, Plr do
  518.                 local GetChar = v.Character
  519.                 if GetChar then
  520.                     local GetHum = GetChar:FindFirstChildOfClass("Humanoid")
  521.                     if GetHum then
  522.                         crap.PLAYER_DATA[v].WalkSpeed = Num
  523.                         GetHum.WalkSpeed = Num
  524.                         Output("Set " .. v.Name .. "'s WalkSpeed to: " .. Num)
  525.                     end
  526.                 end
  527.             end
  528.         end
  529.     end, false)
  530.  
  531.     AddCommand("jp", "jp [player] [num]", "Give x player x JumpPower. (Num can be DEFAULT)", function(Plr, Num)
  532.         Plr = FindPlayer(Plr)
  533.         Num = tonumber(Num) or 50
  534.         if Plr ~= nil then
  535.             for _, v in next, Plr do
  536.                 local GetChar = v.Character
  537.                 if GetChar then
  538.                     local GetHum = GetChar:FindFirstChildOfClass("Humanoid")
  539.                     if GetHum then
  540.                         crap.PLAYER_DATA[v].JumpPower = Num
  541.                         GetHum.JumpPower = Num
  542.                         Output("Set " .. v.Name .. "'s JumpPower to: " .. Num)
  543.                     end
  544.                 end
  545.             end
  546.         end
  547.     end, false)
  548.  
  549.  
  550.  
  551.     -- DEVELOPER COMMANDS
  552.     AddCommand("devmode", "devmode", "Toggle Developer Mode.", function()
  553.         crap.DEV_MODE = not crap.DEV_MODE
  554.         if crap.DEV_MODE then
  555.             Output("Developer Mode: ENABLED", Color3.new(0, 1, 0))
  556.         else
  557.             Output("Developer Mode: DISABLED", Color3.new(1, 0, 0))
  558.         end
  559.     end, false)
  560.  
  561.     AddCommand("loopcmd", "loopcmd [command] [args]", "Loop a command with x arguments.", function(...)
  562.         local command = table.concat({...}, " ")
  563.         crap.LOOP_COMMANDS[#crap.LOOP_COMMANDS + 1] = command
  564.         Output("Looping command: " .. command)
  565.     end, false)
  566.  
  567.     AddCommand("clearloops", "clearloops", "Clear all looped commands.", function()
  568.         for i, v in next, crap.LOOP_COMMANDS do
  569.             table.remove(crap.LOOP_COMMANDS, i)
  570.         end
  571.     end)
  572.  
  573.  
  574.  
  575.     -- HI-JACKING COMMANDS
  576.     AddCommand("hijack", "hijack [method] [find]", "Hi-Jack a Metamethod (Default FindPartOnRay)", function(method, find)
  577.         crap.HI_JACKING = method
  578.         crap.HI_JACKING_FIND = find
  579.         Output("Set Hi-Jacking to: " .. method)
  580.     end, false)
  581.  
  582.     AddCommand("printhijack", "printhijack", "Print all up-values, and locals.", function()
  583.         crap.PRINT_HIJACKING = not crap.PRINT_HIJACKING
  584.         Output("Command ran successfully!")
  585.     end, false)
  586.  
  587.     AddCommand("printalltables", "printalltables", "Print all tables in up-values, and locals.", function()
  588.         crap.PRINT_ALL_TABLES = not crap.PRINT_ALL_TABLES
  589.         Output("Command ran successfully!")
  590.     end, false)
  591.  
  592.     AddCommand("newtable", "newtable [table]", "Create a new table.", function(table)
  593.         crap.HI_JACK_TABLES[table] = { }
  594.         Output("Created table: " .. table)
  595.     end, false)
  596.  
  597.     AddCommand("copytable", "copytable [table]", "No Information.", function(table)
  598.         crap.COPY_TABLE = table
  599.         Output("Will copy table: " .. table)
  600.     end, false)
  601.  
  602.     AddCommand("settable", "settable [table]", "No Information.", function(table)
  603.         if crap.SET_TABLE == nil then
  604.             if crap.HI_JACK_TABLES[tonumber(table) or table] ~= nil then
  605.                 crap.SET_TABLE = crap.HI_JACK_TABLES[tonumber(table) or table]
  606.             end
  607.         else
  608.             crap.SET_TABLE = crap.SET_TABLE[tonumber(table) or table]
  609.         end
  610.         Output("Command ran successfully!")
  611.     end, false)
  612.  
  613.     AddCommand("edittable", "edittable [prop] [value]", "No Information.", function(prop, newval, ...)
  614.         if crap.SET_TABLE == nil then return Output("ERROR: Must set the table first!", Color3.new(1, 0, 0)) end
  615.  
  616.         if newval == "true" or newval == "false" then
  617.             crap.SET_TABLE[tonumber(prop) or prop] = (newval == "true" and true or false)
  618.         else
  619.             crap.SET_TABLE[tonumber(prop) or prop] = tonumber(newval) or newval .. " " .. table.concat({...}, " ")
  620.         end
  621.  
  622.         Output("Command ran successfully!")
  623.     end, false)
  624.  
  625.     AddCommand("printtable", "printtable [table]", "No Information.", function(table)
  626.         if crap.HI_JACK_TABLES[table] ~= nil then
  627.             PrintTable(table, crap.HI_JACK_TABLES[table])
  628.             Output("Printed table: " .. table)
  629.         end
  630.     end, false)
  631.  
  632.     AddCommand("printargs", "printargs", "No Information.", function()
  633.         crap.PRINT_ARGUMENTS = not crap.PRINT_ARGUMENTS
  634.         Output("Command ran successfully!")
  635.     end, false)
  636.  
  637.     AddCommand("setupval", "setupval [prop] [newval] [table]", "No Information.", function(prop, newval, table)
  638.         if table == nil then
  639.             if newval == "true" or newval == "false" then
  640.                 crap.UPVALS[prop] = (newval == "true" and true or false)
  641.             elseif tonumber(newval) then
  642.                 crap.UPVALS[prop] = tonumber(newval)
  643.             else
  644.                 crap.UPVALS[prop] = newval
  645.             end
  646.         else
  647.             if crap.HI_JACK_TABLES[table] ~= nil then
  648.                 crap.UPVALS[prop] = crap.HI_JACK_TABLES[table]
  649.             end
  650.         end
  651.         Output("Command ran successfully!")
  652.     end, false)
  653.  
  654.     AddCommand("setlocal", "setlocal [prop] [newval] [table]", "No Information.", function(prop, newval, table)
  655.         if table == nil then
  656.             if newval == "true" or newval == "false" then
  657.                 crap.LOCALS[prop] = (newval == "true" and true or false)
  658.             elseif tonumber(newval) then
  659.                 crap.LOCALS[prop] = tonumber(newval)
  660.             else
  661.                 crap.LOCALS[prop] = newval
  662.             end
  663.         else
  664.             if crap.HI_JACK_TABLES[table] ~= nil then
  665.                 crap.LOCALS[prop] = crap.HI_JACK_TABLES[table]
  666.             end
  667.         end
  668.         Output("Command ran successfully!")
  669.     end, false)
  670.  
  671.     AddCommand("decompilehijack", "decompilehijack", "No Information.", function()
  672.         crap.DECOMPILE_NEXT_HIJACK = true
  673.     end, false)
  674.  
  675.     AddCommand("copybasescript", "copybasescript", "Copy a hi-jack base script.", function()
  676.         Synapse:CopyString(HijackBaseScript)
  677.     end, false)
  678.  
  679.  
  680.     -- REGISTRY COMMANDS
  681.     AddCommand("printreg", "printreg [script]", "Print registry of x script.", function(name)
  682.         name = string.lower(name)
  683.  
  684.         for i = 0, 25 do
  685.             print(" ")
  686.         end
  687.         for i, v in next, getreg() do
  688.             if type(v) == "function" then
  689.                 local env = getfenv(v)
  690.                 if env.script then
  691.                     if env.script.Parent ~= nil then
  692.                         if string.lower(tostring(env.script)) == name then
  693.                             for i2, v2 in next, debug.getupvalues(v) do
  694.                                 warn(i2, v2)
  695.                             end
  696.                         end
  697.                     end
  698.                 end
  699.             end
  700.         end
  701.         Output("Command ran successfully!")
  702.     end, false)
  703.  
  704.     AddCommand("printregtable", "printregtable [script] [table]", "Print table in registry.", function(name, table)
  705.         name = string.lower(name)
  706.  
  707.         for i = 0, 25 do
  708.             print(" ")
  709.         end
  710.         print("TABLE: " .. table)
  711.         for i, v in next, getreg() do
  712.             if type(v) == "function" then
  713.                 local env = getfenv(v)
  714.                 if env.script then
  715.                     if env.script.Parent ~= nil then
  716.                         if string.lower(tostring(env.script)) == name then
  717.                             for i2, v2 in next, debug.getupvalues(v) do
  718.                                 if type(v2) == "table" and i2 == table then
  719.                                     PrintTable(i2, v2)
  720.                                 end
  721.                             end
  722.                         end
  723.                     end
  724.                 end
  725.             end
  726.         end
  727.         Output("Command ran successfully!")
  728.     end, false)
  729.  
  730.     AddCommand("setreg", "setreg [script] [prop] [value]", "No Information.", function(name, prop, newval, ...)
  731.         name = string.lower(name)
  732.  
  733.         for i, v in next, getreg() do
  734.             if type(v) == "function" then
  735.                 local env = getfenv(v)
  736.                 if env.script then
  737.                     if env.script.Parent ~= nil then
  738.                         if string.lower(tostring(env.script)) == name then
  739.                             for i2, v2 in next, debug.getupvalues(v) do
  740.                                 if i2 == prop then
  741.                                     if newval == "true" or newval == "false" then
  742.                                         debug.setupvalue(v, prop, (newval == "true" and true or false))
  743.                                     else
  744.                                         if #{...} >= 1 then
  745.                                             debug.setupvalue(v, prop, newval .. " " .. table.concat({...}, " "))
  746.                                         else
  747.                                             debug.setupvalue(v, prop, tonumber(newval) or newval)
  748.                                         end
  749.                                     end
  750.                                 end
  751.                             end
  752.                         end
  753.                     end
  754.                 end
  755.             end
  756.         end
  757.         Output("Command ran successfully!")
  758.     end, false)
  759.  
  760.     AddCommand("copyregtable", "copyregtable [script] [table]", "No Information.", function(name, table)
  761.         name = string.lower(name)
  762.         for i, v in next, getreg() do
  763.             if type(v) == "function" then
  764.                 local env = getfenv(v)
  765.                 if env.script then
  766.                     if env.script.Parent ~= nil then
  767.                         if string.lower(tostring(env.script)) == name then
  768.                             for i2, v2 in next, debug.getupvalues(v) do
  769.                                 if i2 == table and type(v2) == "table" then
  770.                                     crap.REGISTRY_TABLES[i2] = debug.getupvalue(v, i2)
  771.                                     Output("Table copied successfully!", Color3.new(0, 1, 0))
  772.                                 end
  773.                             end
  774.                         end
  775.                     end
  776.                 end
  777.             end
  778.         end
  779.     end, false)
  780.  
  781.     AddCommand("setregtable", "setregtable [table]", "Sets the current registry table.", function(table)
  782.         if crap.SET_REGISTRY_TABLE == nil then
  783.             if crap.REGISTRY_TABLES[tonumber(table) or table] ~= nil then
  784.                 crap.SET_REGISTRY_TABLE = crap.REGISTRY_TABLES[tonumber(table) or table]
  785.             end
  786.         else
  787.             crap.SET_REGISTRY_TABLE = crap.SET_REGISTRY_TABLE[tonumber(table) or table]
  788.         end
  789.     end, false)
  790.  
  791.     AddCommand("findregvalue", "findregvalue [value]", "Find all registry with value.", function(val)
  792.         for i, v in next, getreg() do
  793.             if type(v) == "function" then
  794.                 local env = getfenv(v)
  795.                 if env.script then
  796.                     if env.script.Parent ~= nil then
  797.                         for i2, v2 in next, debug.getupvalues(v) do
  798.                             if tostring(v2) == val then
  799.                                 Output("Found: " .. i2 .. ": " .. v2 .. " SCRIPT: " .. env.script:GetFullName(), Color3.new(0, 1, 0))
  800.                             end
  801.                         end
  802.                     end
  803.                 end
  804.             end
  805.         end
  806.     end, false)
  807.  
  808.     AddCommand("viewregtable", "viewregtable [table]", "No Information.", function(table)
  809.         if crap.REGISTRY_TABLES[tonumber(table) or table] ~= nil then
  810.             PrintTable(table, crap.REGISTRY_TABLES[tonumber(table) or table])
  811.             Output("Printed table: " .. table)
  812.         end
  813.     end, false)
  814.  
  815.     AddCommand("hijackfunc", "hijackfunc [script] [func]", "Hi-Jack x function in x script.", function(name, func)
  816.         name = string.lower(name)
  817.         for i, v in next, getreg() do
  818.             if type(v) == "function" then
  819.                 local env = getfenv(v)
  820.                 if env.script then
  821.                     if env.script.Parent ~= nil then
  822.                         if string.lower(tostring(env.script)) == name then
  823.                             for i2, v2 in next, debug.getupvalues(v) do
  824.                                 if i2 == func and type(v2) == "function" then
  825.                                     crap.FUNCTIONS[i2] = {v, debug.getupvalue(v, func)}
  826.                                     crap.FUNCTIONS_BACKUP[i2] = debug.getupvalue(v, func)
  827.                                 end
  828.                             end
  829.                         end
  830.                     end
  831.                 end
  832.             end
  833.         end
  834.  
  835.         for i, v in next, crap.FUNCTIONS do
  836.             crap.FUNCTIONS[i][2] = function(...)
  837.                 print("FUNCTION: " .. i .. " CALLED.")
  838.                 for i2, v2 in next, {...} do
  839.                     warn(i2, v2)
  840.                 end
  841.  
  842.                 return crap.FUNCTIONS_BACKUP[i](...)
  843.             end
  844.             debug.setupvalue(crap.FUNCTIONS[i][1], i, crap.FUNCTIONS[i][2])
  845.         end
  846.         Output("Command ran successfully!")
  847.     end, false)
  848.  
  849.     AddCommand("hijacktablefunc", "hijacktablefunc [func]", "No Information.", function(func)
  850.         if crap.SET_REGISTRY_TABLE == nil then return Output("ERROR: Must set the registry table first!", Color3.new(1, 0, 0)) end
  851.  
  852.         if type(crap.SET_REGISTRY_TABLE[func]) == "function" then
  853.             crap.FUNCTIONS_BACKUP[func] = crap.SET_REGISTRY_TABLE[func]
  854.             crap.SET_REGISTRY_TABLE[func] = function(...)
  855.                 print("FUNCTION: " .. func .. " CALLED!")
  856.                 for i, v in next, {...} do
  857.                     warn(tostring(i), tostring(v))
  858.                 end
  859.             end
  860.         end
  861.     end, false)
  862.  
  863.     AddCommand("execfunc", "execfunc [script] [func] [args]", "Execute a function NOT in a table.", function(name, func, ...)
  864.         name = string.lower(name)
  865.  
  866.         local args = {...} or {nil}
  867.         if args[1] ~= nil then
  868.             for i, v in next, args do
  869.                 if tostring(v) == "true" or tostring(v) == "false" then
  870.                     v = tostring(v) == "true" and true or false
  871.                 else
  872.                     v = tonumber(v) or v
  873.                 end
  874.             end
  875.         end
  876.  
  877.         for i, v in next, getreg() do
  878.             if type(v) == "function" then
  879.                 local env = getfenv(v)
  880.                 if env.script then
  881.                     if env.script.Parent ~= nil then
  882.                         if string.lower(tostring(env.script)) == name then
  883.                             for i2, v2 in next, debug.getupvalues(v) do
  884.                                 if i2 == func and type(v2) == "function" then
  885.                                     v2(unpack(args))
  886.                                 end
  887.                             end
  888.                         end
  889.                     end
  890.                 end
  891.             end
  892.         end
  893.  
  894.         Output("Command ran successfully!")
  895.     end, false)
  896.  
  897.     AddCommand("exectablefunc", "exectablefunc [func] [args]", "Execute a function in a table you copied.", function(func, ...)
  898.         local args = {...} or {nil}
  899.         if args[1] ~= nil then
  900.             for i, v in next, args do
  901.                 if tostring(v) == "true" or tostring(v) == "false" then
  902.                     v = tostring(v) == "true" and true or false
  903.                 else
  904.                     v = tonumber(v) or v
  905.                 end
  906.             end
  907.         end
  908.  
  909.         if crap.SET_REGISTRY_TABLE ~= nil then
  910.             if crap.SET_REGISTRY_TABLE[func] ~= nil then
  911.                 crap.SET_REGISTRY_TABLE[func](crap.SET_REGISTRY_TABLE, unpack(args))
  912.             else
  913.                 Output("ERROR: Function doesn't exist!", Color3.new(1, 0, 0))
  914.             end
  915.         else
  916.             return Output("ERROR: Must set the table first!", Color3.new(1, 0, 0))
  917.         end
  918.     end, false)
  919.  
  920.     AddCommand("unhijacktablefunc", "unhijacktablefunc [func]", "No Information.", function(func)
  921.         if crap.SET_REGISTRY_TABLE == nil then return Output("ERROR: Must set the registry table first!", Color3.new(1, 0, 0)) end
  922.         if crap.FUNCTIONS_BACKUP[func] == nil then return Output("ERROR: That function was never hi-jacked!", Color3.new(1, 0, 0)) end
  923.  
  924.         crap.SET_REGISTRY_TABLE[func] = crap.FUNCTIONS_BACKUP[func]
  925.         Output("Command ran successfully!")
  926.     end, false)
  927.  
  928.     AddCommand("clearfunchijacks", "clearfunchijacks", "Clear all function hi-jacks.", function(func)
  929.         for i, v in next, crap.FUNCTIONS do
  930.             debug.setupvalue(crap.FUNCTIONS[i][1], i, crap.FUNCTIONS_BACKUP[i])
  931.         end
  932.         Output("Command ran successfully!")
  933.     end, false)
  934.  
  935.     AddCommand("copyregbasescript", "copyregbasescript", "Copy a registry hi-jacking base script.", function()
  936.         Synapse:CopyString(regbase_script)
  937.     end)
  938.  
  939.  
  940.  
  941.     -- MENU COMMANDS
  942.     AddCommand("clear", "clear", "Clear the console.", function()
  943.         output:ClearAllChildren()
  944.     end, false)
  945.  
  946.     AddCommand("help", "help", "", function()
  947.         for i, v in next, crap.COMMANDS do
  948.             Output(v.Command .. " <--" .. v.Info)
  949.         end
  950.     end, false)
  951.  
  952.     input.FocusLost:connect(function()
  953.         Output("> " .. input.Text)
  954.         RunCommand(input.Text)
  955.         input.Text = "Click Here, or Press the \".\" Key to Enter a Command."
  956.     end)
  957.  
  958.     i.InputBegan:connect(function(inp, ingui)
  959.         if not ingui then
  960.             if inp.UserInputType == Enum.UserInputType.Keyboard then
  961.                 if inp.KeyCode == Enum.KeyCode.F4 then
  962.                     output.Visible = not output.Visible
  963.                     cover.Visible = not cover.Visible
  964.                     input.Visible = not input.Visible
  965.                 end
  966.                 if inp.KeyCode == Enum.KeyCode.Period then
  967.                     input:CaptureFocus()
  968.                 end
  969.             end
  970.         end
  971.     end)
  972.  
  973.     r:BindToRenderStep("Hi-Jack", 1000, function()
  974.         for i, v in next, crap.LOOP_COMMANDS do
  975.             RunCommand(v)
  976.         end
  977.  
  978.         if crap.DECOMPILE_SCRIPT ~= nil then
  979.             Synapse:WriteFile(crap.DECOMPILE_SCRIPT.Name .. ".lua", Synapse:Decompile(crap.DECOMPILE_SCRIPT))
  980.             crap.DECOMPILED_SCRIPTS[crap.DECOMPILE_SCRIPT] = crap.DECOMPILE_SCRIPT
  981.             crap.DECOMPILE_SCRIPT = nil
  982.         end
  983.     end)
  984.  
  985.     Output("This console is currently in very early development! More commands will be added!", Color3.new(0, 1, 0))
  986.     Output("PRESS F4 TO TOGGLE THE GUI!", Color3.new(0, 1, 0))
  987.     Output("Version: 0.8 (Added several new commands. (Check my YOUTUBE channel)) Enter command help for more details.", Color3.new(0, 1, 1))
  988.     Output("Made by: Racist Dolphin#5199", Color3.new(0, 1, 0))
  989.     if crap.FE then
  990.         Output("FilteringEnabled DETECTED!", Color3.new(1, 0, 0))
  991.     end
  992. end
  993.  
  994. function Init()
  995.     ps.PlayerAdded:connect(CreatePlayerData)
  996.     ps.PlayerRemoving:connect(RemovePlayerData)
  997.     for i, v in pairs(ps:GetPlayers()) do
  998.         CreatePlayerData(v)
  999.     end
  1000.     InitGui()
  1001. end
  1002.  
  1003. Init()
  1004.  
  1005. m.__namecall = function(...)
  1006.     local t = {...}
  1007.     local method = t[#t]
  1008.  
  1009.     if crap.DEV_MODE then
  1010.         if method == crap.HI_JACKING then
  1011.             local env = getfenv(2)
  1012.             if env.script then
  1013.                 if env.script.Parent ~= nil then
  1014.                     if crap.DECOMPILE_NEXT_HIJACK then
  1015.                         if crap.DECOMPILED_SCRIPTS[env.script] == nil then
  1016.                             crap.DECOMPILE_SCRIPT = env.script
  1017.                             Output("DECOMPILED SCRIPT: " .. tostring(env.script))
  1018.                         end
  1019.                     end
  1020.  
  1021.                     if crap.PRINT_ARGUMENTS then
  1022.                         print(method .. "'s arguments:")
  1023.                         for i, v in next, t do
  1024.                             warn(i, v)
  1025.                         end
  1026.                     end
  1027.  
  1028.                     if crap.HI_JACKING_FIND ~= nil then
  1029.                         local found = false
  1030.                         for i, v in next, t do
  1031.                             if tostring(v) == crap.HI_JACKING_FIND then
  1032.                                 found = true
  1033.                                 break
  1034.                             end
  1035.                         end
  1036.                         if not found then return oldnamecall(...) end
  1037.                     end
  1038.  
  1039.                     if crap.PRINT_HIJACKING then
  1040.                         for i = 0, 15 do
  1041.                             print(" ")
  1042.                         end
  1043.  
  1044.                         local upv = debug.getupvalues(2)
  1045.                         local locals = debug.getlocals(2)
  1046.  
  1047.                         print("SCRIPT: " .. env.script:GetFullName())
  1048.                         print(" ")
  1049.                         print("UP VALUES: ")
  1050.                         for i, v in next, upv do
  1051.                             warn(i, v)
  1052.                             if type(v) == "table" and crap.PRINT_ALL_TABLES then
  1053.                                 PrintTable(i, v)
  1054.                                 if i == crap.COPY_TABLE then
  1055.                                     crap.HI_JACK_TABLES[i] = CloneTable(v)
  1056.                                     crap.COPY_TABLE = nil
  1057.                                 end
  1058.                             end
  1059.                         end
  1060.                         print("LOCALS: ")
  1061.                         for i, v in next, locals do
  1062.                             warn(i, v)
  1063.                             if type(v) == "table" and crap.PRINT_ALL_TABLES then
  1064.                                 PrintTable(i, v)
  1065.                                 if i == crap.COPY_TABLE then
  1066.                                     crap.HI_JACK_TABLES[i] = CloneTable(v)
  1067.                                     crap.COPY_TABLE = nil
  1068.                                 end
  1069.                             end
  1070.                         end
  1071.                     end
  1072.                     -- WRITE DATA
  1073.                     for i, v in next, crap.UPVALS do
  1074.                         if debug.getupvalue(2, i) ~= nil then
  1075.                             debug.setupvalue(2, i, v)
  1076.                         end
  1077.                     end
  1078.  
  1079.                     for i, v in next, crap.LOCALS do
  1080.                         if debug.getlocal(2, i) ~= nil then
  1081.                             debug.setlocal(2, i, v)
  1082.                         end
  1083.                     end
  1084.                 end
  1085.             end
  1086.         end
  1087.     end
  1088.  
  1089.     return oldnamecall(...)
  1090. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement