AlphaZyro

Nameless Admin Copy

Mar 15th, 2021
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- this is old code broother
  2.  
  3. local opt = {
  4.     prefix = ';',           -- ;ff me | /ff me
  5.     tupleSeparator = ',',   -- ;ff me,others,all | ;ff me/others/all
  6.     ui = {                  -- never did anything with this
  7.        
  8.     },
  9.     keybinds = {            -- never did anything with this
  10.        
  11.     },
  12. }
  13.  
  14. --[[ VARIABLES ]]--
  15. local Players = game:GetService("Players")
  16. local UserInputService = game:GetService("UserInputService")
  17. local TweenService = game:GetService("TweenService")
  18. local RunService = game:GetService("RunService")
  19. local StarterGui = game:GetService("StarterGui")
  20. local SoundService = game:GetService("SoundService")
  21.  
  22. local localPlayer = Players.LocalPlayer
  23. local character = localPlayer.Character
  24. local mouse = localPlayer:GetMouse()
  25. local camera = workspace.CurrentCamera
  26. local camtype = camera.CameraType
  27. local Commands, Aliases = {}, {}
  28. player, plr, lp = localPlayer, localPlayer, localPlayer, localPlayer
  29.  
  30. localPlayer.CharacterAdded:Connect(function(c)
  31.     character = c
  32. end)
  33.  
  34. --[[ COMMAND FUNCTIONS ]]--
  35. cmd = {}
  36. cmd.add = function(...)
  37.     local vars = {...}
  38.     local aliases, info, func = vars[1], vars[2], vars[3]
  39.     for i, cmdName in pairs(aliases) do
  40.         if i == 1 then
  41.             Commands[cmdName:lower()] = {func, info}
  42.         else
  43.             Aliases[cmdName:lower()] = {func, info}
  44.         end
  45.     end
  46. end
  47.  
  48. cmd.run = function(args)
  49.     local caller, arguments = args[1], args; table.remove(args, 1);
  50.     local success, msg = pcall(function()
  51.         if Commands[caller:lower()] then
  52.             Commands[caller:lower()][1](unpack(arguments))
  53.         elseif Aliases[caller:lower()] then
  54.             Aliases[caller:lower()][1](unpack(arguments))
  55.         end
  56.     end)
  57.     if not success then
  58.         lib.messageOut("Admin error", msg)
  59.     end
  60. end
  61.  
  62. --[[ LIBRARY FUNCTIONS ]]--
  63. lib = {}
  64. lib.wrap = function(f)
  65.     return coroutine.wrap(f)()
  66. end
  67. wrap = lib.wrap
  68.  
  69. lib.messageOut = function(title, msg)
  70.     StarterGui:SetCore("SendNotification",
  71.         {
  72.             Title = title,
  73.             Text = msg
  74.         }
  75.     )
  76. end
  77.  
  78. local wait = function(int)
  79.     if not int then int = 0 end
  80.     local t = tick()
  81.     repeat
  82.         RunService.Heartbeat:Wait(0)
  83.     until (tick() - t) >= int
  84.     return (tick() - t), t
  85. end
  86. spawn(function()
  87.     lib.messageOut("Admin successfully loaded", "Have fun!")
  88. end)
  89.  
  90. lib.lock = function(instance, par)
  91.     locks[instance] = true
  92.     instance.Parent = par or instance.Parent
  93.     instance.Name = "RightGrip"
  94. end
  95. lock = lib.lock
  96. locks = {}
  97. if hookfunction then    -- i believe this was for hiding stuff like bodyvelocity
  98.     local pseudo = Instance.new("Motor6D")
  99.     _1 = hookfunction(pseudo.IsA, function(...)
  100.         local p, ret = ({...})[1], _1(...)
  101.         if checkcaller() then return ret end
  102.         if locks[p] then
  103.             return false
  104.         end
  105.         return ret
  106.     end)
  107.     _2 = hookfunction(pseudo.FindFirstChildWhichIsA, function(...)
  108.         local p = _2(...)
  109.         if checkcaller() then return p end
  110.         if locks[p] then
  111.             return nil
  112.         end
  113.         return p
  114.     end)
  115.     _3 = hookfunction(pseudo.FindFirstChildOfClass, function(...)
  116.         local p = _3(...)
  117.         if checkcaller() then return p end
  118.         if locks[p] then
  119.             return nil
  120.         end
  121.         return p
  122.     end)
  123.     _4 = hookfunction(pseudo.Destroy, function(...)
  124.         local args = {...}
  125.         if checkcaller() then return _4(...) end
  126.         if locks[args[1]] then return end
  127.         return
  128.     end)
  129.    
  130.     local mt = getrawmetatable(game)
  131.     local _ni = mt.__newindex
  132.     local _nc = mt.__namecall
  133.     local _i = mt.__index
  134.     setreadonly(mt, false)
  135.    
  136.     mt.__index = newcclosure(function(t, i)
  137.         if locks[t] and not checkcaller() then
  138.             return _i(pseudo, i)
  139.         end
  140.         return _i(t, i)
  141.     end)
  142.     mt.__newindex = newcclosure(function(t, i, v)
  143.         if locks[t] and not checkcaller() then
  144.             return _ni(pseudo, i, v)
  145.         end
  146.         return _ni(t, i, v)
  147.     end)
  148.     mt.__namecall = newcclosure(function(t, ...)
  149.         if locks[t] and not checkcaller() then
  150.             return _nc(pseudo, ...)
  151.         end
  152.         return _nc(t, ...)
  153.     end)
  154. end
  155.  
  156. lib.find = function(t, v)   -- mmmmmm
  157.     for i, e in pairs(t) do
  158.         if i == v or e == v then
  159.             return i
  160.         end
  161.     end
  162.     return nil
  163. end
  164.  
  165. lib.parseText = function(text, watch)
  166.     local parsed = {}
  167.     if not text then return nil end
  168.     for arg in text:gmatch("[^" .. watch .. "]+") do
  169.         arg = arg:gsub("-", "%%-")
  170.         local pos = text:find(arg)
  171.         arg = arg:gsub("%%", "")
  172.         if pos then
  173.             local find = text:sub(pos - opt.prefix:len(), pos - 1)
  174.             if (find == opt.prefix and watch == opt.prefix) or watch ~= opt.prefix then
  175.                 table.insert(parsed, arg)
  176.             end
  177.         else
  178.             table.insert(parsed, nil)
  179.         end
  180.     end
  181.     return parsed
  182. end
  183.  
  184. lib.parseCommand = function(text)
  185.     wrap(function()
  186.         local commands = lib.parseText(text, opt.prefix)
  187.         for _, parsed in pairs(commands) do
  188.             local args = {}
  189.             for arg in parsed:gmatch("[^ ]+") do
  190.                 table.insert(args, arg)
  191.             end
  192.             cmd.run(args)
  193.         end
  194.     end)
  195. end
  196.  
  197. local connections = {}
  198.  
  199. lib.connect = function(name, connection)    -- no :(
  200.     connections[name .. tostring(math.random(1000000, 9999999))] = connection
  201.     return connection
  202. end
  203.  
  204. lib.disconnect = function(name)
  205.     for title, connection in pairs(connections) do
  206.         if title:find(name) == 1 then
  207.             connection:Disconnect()
  208.         end
  209.     end
  210. end
  211.  
  212. m = math            -- prepare for annoying and unnecessary tool grip math
  213. rad = m.rad
  214. clamp = m.clamp
  215. sin = m.sin
  216. tan = m.tan
  217. cos = m.cos
  218.  
  219. --[[ PLAYER FUNCTIONS ]]--
  220. argument = {}
  221. argument.getPlayers = function(str)
  222.     local playerNames, players = lib.parseText(str, opt.tupleSeparator), {}
  223.     for _, arg in pairs(playerNames or {"me"}) do
  224.         arg = arg:lower()
  225.         local playerList = Players:GetPlayers()
  226.         if arg == "me" or arg == nil then
  227.             table.insert(players, localPlayer)
  228.            
  229.         elseif arg == "all" then
  230.             for _, plr in pairs(playerList) do
  231.                 table.insert(players, plr)
  232.             end
  233.            
  234.         elseif arg == "others" then
  235.             for _, plr in pairs(playerList) do
  236.                 if plr ~= localPlayer then
  237.                     table.insert(players, plr)
  238.                 end
  239.             end
  240.            
  241.         elseif arg == "random" then
  242.             table.insert(players, playerList[math.random(1, #playerList)])
  243.            
  244.         elseif arg:find("%%") == 1 then
  245.             local teamName = arg:sub(2)
  246.             for _, plr in pairs(playerList) do
  247.                 if tostring(plr.Team):lower():find(teamName) == 1 then
  248.                     table.insert(players, plr)
  249.                 end
  250.             end
  251.            
  252.         else
  253.             for _, plr in pairs(playerList) do
  254.                 if plr.Name:lower():find(arg) == 1 then
  255.                     table.insert(players, plr)
  256.                 end
  257.             end
  258.         end
  259.     end
  260.     return players
  261. end
  262.  
  263. --[[ COMMANDS ]]--
  264.  
  265. --[ SCRIPT ]--
  266. cmd.add({"script", "ls", "s", "run"}, {"script <source>", "Run the code requested"}, function(source)
  267.     loadstring(source)()
  268. end)
  269.  
  270. cmd.add({"httpget", "hl", "get"}, {"httpget <url>", "Run the contents of a given URL"}, function(url)
  271.     loadstring(game:HttpGet(url, true))()
  272. end)
  273.  
  274. --[ UTILITY ]--
  275. cmd.add({"devconsole", "developerconsole", "console"}, {"devconsole", "Open the old developer console"}, function()
  276.     StarterGui:SetCore("DeveloperConsoleVisible", true)
  277. end)
  278.  
  279. cmd.add({"chatlogs", "clogs"}, {"chatlogs", "Open the chat logs"}, function()
  280.     gui.chatlogs()
  281. end)
  282.  
  283. cmd.add({"commands", "cmds"}, {"commands", "Open the command list"}, function()
  284.     gui.commands()
  285. end)
  286.  
  287. cmd.add({"print", "p"}, {"print <tuple>", "Print the given arguments"}, function(...)
  288.     print(...)
  289. end)
  290.  
  291. cmd.add({"warn", "w"}, {"warn <tuple>", "Warn the given arguments"}, function(...)
  292.     warn(...)
  293. end)
  294.  
  295. cmd.add({"rejoin", "rj"}, {"rejoin", "Rejoin the game"}, function()
  296.     game:GetService("TeleportService"):Teleport(game.PlaceId)
  297. end)
  298.  
  299. cmd.add({"place", "game", "join"}, {"place <placeId> [player]", "Join a place with the given PlaceId or a player's server"}, function(placeid, playerName)
  300.     game:GetService("TeleportService"):Teleport(placeid, playerName)
  301. end)
  302.  
  303. cmd.add({"disconnectevents", "disableevents"}, {"disconnectevents <instance> <event>", "Disable the given instance's connections to the event"}, function(objDir, event)
  304.     local obj = loadstring("return " .. objDir)()
  305.     local events = getconnections(obj[event])
  306.     for _, connection in pairs(events) do
  307.         connection:Disable()
  308.     end
  309. end)
  310.  
  311. cmd.add({"connectevents", "enableevents"}, {"connectevents <instance> <event>", "Enable the given instance's connections to the event"}, function(objDir, event)
  312.     local obj = loadstring("return " .. objDir)()
  313.     local events = getconnections(obj[event])
  314.     for _, connection in pairs(events) do
  315.         connection:Enable()
  316.     end
  317. end)
  318.  
  319. wrap(function()
  320.     --i am so not putting an emulator as a command here
  321. end)
  322.  
  323. --[ LOCALPLAYER ]--
  324. local function respawn()
  325.     character:ClearAllChildren()
  326.     local newChar = Instance.new("Model", workspace)
  327.     local hum = Instance.new("Humanoid", newChar)
  328.     local torso = Instance.new("Part", newChar)
  329.     newChar.Name = "respawn_"
  330.     torso.Name = "Torso"
  331.     torso.Transparency = 1
  332.     player.Character = newChar
  333.     newChar:MoveTo(Vector3.new(999999, 999999, 999999))
  334.     torso.Name = ""
  335.     torso.CanCollide = false
  336. end
  337.  
  338. local function refresh()
  339.     local cf, p = CFrame.new(), character:FindFirstChild("HumanoidRootPart") or character:FindFirstChild("Head")
  340.     if p then
  341.         cf = p.CFrame
  342.     end
  343.     respawn()
  344.     player.CharacterAdded:Wait(); wait(0.2);
  345.     character:WaitForChild("HumanoidRootPart").CFrame = cf
  346. end
  347.  
  348. local abort = 0
  349. local function getTools(amt)
  350.     if not amt then amt = 1 end
  351.     local toolAmount, grabbed = 0, {}
  352.     local lastCF = character.PrimaryPart.CFrame
  353.     local ab = abort
  354.    
  355.     for i, v in pairs(localPlayer:FindFirstChildWhichIsA("Backpack"):GetChildren()) do
  356.         if v:IsA("BackpackItem") then
  357.             toolAmount = toolAmount + 1
  358.         end
  359.     end
  360.     if toolAmount >= amt then return localPlayer:FindFirstChildWhichIsA("Backpack"):GetChildren() end
  361.     if not localPlayer:FindFirstChildWhichIsA("Backpack"):FindFirstChildWhichIsA("BackpackItem") then return end
  362.    
  363.     repeat
  364.         repeat wait() until localPlayer:FindFirstChildWhichIsA("Backpack") or ab ~= abort
  365.         backpack = localPlayer:FindFirstChildWhichIsA("Backpack")
  366.         wrap(function()
  367.             repeat wait() until backpack:FindFirstChildWhichIsA("BackpackItem")
  368.             for _, tool in pairs(backpack:GetChildren()) do
  369.                 if #grabbed >= amt or ab ~= abort then break end
  370.                 if tool:IsA("BackpackItem") then
  371.                     tool.Parent = localPlayer
  372.                     table.insert(grabbed, tool)
  373.                 end
  374.             end
  375.         end)
  376.        
  377.         respawn()
  378.         wait(.1)
  379.     until
  380.         #grabbed >= amt or ab ~= abort
  381.    
  382.     repeat wait() until localPlayer.Character and tostring(localPlayer.Character) ~= "respawn_" and localPlayer.Character == character
  383.     wait(.2)
  384.    
  385.     repeat wait() until localPlayer:FindFirstChildWhichIsA("Backpack") or ab ~= abort
  386.     local backpack = localPlayer:FindFirstChildWhichIsA("Backpack")
  387.     for _, tool in pairs(grabbed) do
  388.         if tool:IsA("BackpackItem") then
  389.             tool.Parent = backpack
  390.         end
  391.     end
  392.     wrap(function()
  393.         repeat wait() until character.PrimaryPart
  394.         wait(.2)
  395.         character:SetPrimaryPartCFrame(lastCF)
  396.     end)
  397.     wait(.2)
  398.     return grabbed
  399. end
  400.  
  401. cmd.add({"notoolscripts", "nts"}, {"notoolscripts", "Destroy all scripts in backpack"}, function()
  402.     local bp = player:FindFirstChildWhichIsA("Backpack")
  403.     for _, item in pairs(bp:GetChildren()) do
  404.         for _, obj in pairs(item:GetDescendants()) do
  405.             if obj:IsA("LocalScript") or obj:IsA("Script") then
  406.                 obj.Disabled = true
  407.                 obj:Destroy()
  408.             end
  409.         end
  410.     end
  411. end)
  412.  
  413. cmd.add({"clonetools", "dupetools"}, {"clonetools [amount]", "Clone your tools by the given amount"}, function(amt)
  414.     amt = tonumber(amt) or 1
  415.     getTools(math.clamp(amt, 1, 100))
  416. end)
  417.  
  418. cmd.add({"abort"}, {"abort", "Abort most indefinite operations"}, function(amt)
  419.     abort = abort + 1   -- terrifying system
  420. end)
  421.  
  422. cmd.add({"blockspam"}, {"blockspam [amount]", "Spawn blocks by the given amount"}, function(amt)
  423.     amt = tonumber(amt) or 1
  424.     local hatAmount, grabbed = 0, {}
  425.     local lastCF = character.PrimaryPart.CFrame
  426.     character:ClearAllChildren()
  427.     respawn()
  428.     repeat
  429.         if character.Name ~= "respawn_" then
  430.             local c = character
  431.             repeat wait() until c:FindFirstChildWhichIsA("Accoutrement")
  432.             c:MoveTo(lastCF.p)
  433.             wait(1)
  434.             for i, v in pairs(c:GetChildren()) do
  435.                 if v:IsA("Accoutrement") then
  436.                     v:WaitForChild("Handle")
  437.                     v.Handle.CanCollide = true
  438.                     if v:FindFirstChildWhichIsA("DataModelMesh", true) then
  439.                         v:FindFirstChildWhichIsA("DataModelMesh", true):Destroy()
  440.                     end
  441.                     v.Parent = workspace
  442.                     table.insert(grabbed, v)
  443.                 end
  444.             end
  445.             hatAmount = hatAmount + 1
  446.         end
  447.         character:ClearAllChildren()
  448.         respawn()
  449.         wait()
  450.     until
  451.         hatAmount >= amt
  452.    
  453.     repeat wait() until tostring(localPlayer.Character) ~= "respawn_" and localPlayer.Character
  454.     wait(0.5)
  455.    
  456.     spawn(function()
  457.         repeat wait() until character.PrimaryPart
  458.         wait(0.2)
  459.         character:SetPrimaryPartCFrame(lastCF)
  460.        
  461.         for _, item in pairs(grabbed) do
  462.             if item:IsA("Accoutrement") and item:FindFirstChild("Handle") then
  463.                 item.Parent = workspace
  464.                 wait()
  465.             end
  466.         end
  467.     end)
  468. end)
  469.  
  470. cmd.add({"toolblockspam"}, {"toolblockspam [amount]", "Spawn blocks by the given amount"}, function(amt)
  471.     if not amt then amt = 1 end
  472.     amt = tonumber(amt)
  473.     local tools = getTools(amt)
  474.     for i, tool in pairs(tools) do
  475.         wait()
  476.         spawn(function()
  477.             wait(0.5)
  478.             tool.Parent = character
  479.             tool.CanBeDropped = true
  480.             wait(0.4)
  481.             for _, mesh in pairs(tool:GetDescendants()) do
  482.                 if mesh:IsA("DataModelMesh") then
  483.                     mesh:Destroy()
  484.                 end
  485.             end
  486.             for _, weld in pairs(character:GetDescendants()) do
  487.                 if weld.Name == "RightGrip" then
  488.                     weld:Destroy()
  489.                 end
  490.             end
  491.             wait(0.1)
  492.             tool.Parent = workspace
  493.         end)
  494.     end
  495. end)
  496.  
  497. cmd.add({"clonehats", "dupehats"}, {"clonehats [amount]", "Clone your hats by the given amount"}, function(amt)
  498.     amt = tonumber(amt) or 1
  499.     local hatAmount, grabbed = 0, {}
  500.     local lastCF = character.PrimaryPart.CFrame
  501.     character:ClearAllChildren()
  502.     respawn()
  503.     repeat
  504.         if character.Name ~= "respawn_" then
  505.             repeat wait() until character:FindFirstChildWhichIsA("Accoutrement")
  506.             wait(0.75)
  507.             character:MoveTo(lastCF.p)
  508.             wait(0.25)
  509.             for i, v in pairs(character:GetChildren()) do
  510.                 if v:IsA("Accoutrement") then
  511.                     v:WaitForChild("Handle")
  512.                     v.Parent = workspace
  513.                     table.insert(grabbed, v)
  514.                 end
  515.             end
  516.             hatAmount = hatAmount + 1
  517.         end
  518.         character:ClearAllChildren()
  519.         respawn()
  520.         wait()
  521.     until
  522.         hatAmount >= amt
  523.    
  524.     repeat wait() until tostring(localPlayer.Character) ~= "respawn_" and localPlayer.Character
  525.     wait(0.5)
  526.    
  527.     spawn(function()
  528.         repeat wait() until character.PrimaryPart
  529.         wait(0.2)
  530.         character:SetPrimaryPartCFrame(lastCF)
  531.        
  532.         for _, hat in pairs(grabbed) do
  533.             if hat:IsA("Accoutrement") and hat:FindFirstChild("Handle") then
  534.                 hat.Parent = workspace
  535.                 wait()
  536.             end
  537.         end
  538.     end)
  539. end)
  540.  
  541. cmd.add({"equiptools", "equipall"}, {"equiptools", "Equip all of your tools"}, function()
  542.     local backpack = localPlayer:FindFirstChildWhichIsA("Backpack")
  543.     if backpack then
  544.         for _, tool in pairs(backpack:GetChildren()) do
  545.             if tool:IsA("Tool") then
  546.                 tool.Parent = character
  547.             end
  548.         end
  549.     end
  550. end)
  551.  
  552. cmd.add({"droptools"}, {"droptools", "Drop your equipped tools"}, function()
  553.     for _, tool in pairs(character:GetChildren()) do
  554.         if tool:IsA("Tool") then
  555.             tool.Parent = workspace
  556.         end
  557.     end
  558. end)
  559.  
  560. cmd.add({"unequiptools"}, {"unequiptools", "Unequip your equipped tools"}, function()
  561.     local h = character:FindFirstChildWhichIsA("Humanoid")
  562.     if h then
  563.         h:UnequipTools()
  564.     end
  565. end)
  566.  
  567. cmd.add({"notools"}, {"notools", "Remove your tools"}, function()
  568.     for _, tool in pairs(character:GetChildren()) do
  569.         if tool:IsA("Tool") then
  570.             tool:Destroy()
  571.         end
  572.     end
  573.     for _, tool in pairs(localPlayer.Backpack:GetChildren()) do
  574.         if tool:IsA("Tool") then
  575.             tool:Destroy()
  576.         end
  577.     end
  578. end)
  579.  
  580. cmd.add({"toolkill"}, {"toolkill <player>", "Kill the given players without FE god"}, function(p)
  581.     local players = argument.getPlayers(p)
  582.     local backpack = localPlayer:FindFirstChildWhichIsA("Backpack")
  583.     local hum = character:FindFirstChildWhichIsA("Humanoid")
  584.     local root = character:FindFirstChild("HumanoidRootPart")
  585.     local point = root.CFrame
  586.    
  587.     if not backpack:FindFirstChildWhichIsA("Tool") then
  588.         lib.messageOut("toolkill", "Cannot bring players, no tools found")
  589.         return
  590.     end
  591.    
  592.     if backpack and hum then
  593.         local tools = getTools(#players+1)
  594.         wait()
  595.         for i, v in pairs(tools) do
  596.             v.Parent = character
  597.         end
  598.         wait()
  599.         for i, v in pairs(tools) do
  600.             v.Parent = workspace
  601.         end
  602.         wait(.2)
  603.         for key, player in pairs(players) do
  604.             local target = player.Character
  605.             if target and player ~= localPlayer then
  606.                 root = character:FindFirstChild("HumanoidRootPart")
  607.                 local assignedTool = tools[key+1]
  608.                 local handle = assignedTool:FindFirstChild("Handle")
  609.                 local targetPart = target:FindFirstChild("HumanoidRootPart")
  610.                 if handle and targetPart then
  611.                     local schar = character
  612.                     repeat
  613.                         wait()
  614.                         root.CFrame = CFrame.new(900, workspace.FallenPartsDestroyHeight+15, 900)
  615.                         root.Velocity = Vector3.new(0, 0, 0)
  616.                         targetPart.CFrame = CFrame.new(root.Position + root.CFrame.rightVector)
  617.                     until
  618.                         assignedTool.Parent ~= workspace or localPlayer.Character ~= schar
  619.                    
  620.                     wait(0.1)
  621.                     for i, v in pairs(character:GetDescendants()) do
  622.                         if v.Name:find("Grip") and v:isA("Weld") then
  623.                             v:Destroy()
  624.                         end
  625.                     end
  626.                     wait()
  627.                     root.CFrame = point
  628.                 end
  629.             end
  630.         end
  631.     end
  632. end)
  633.  
  634. cmd.add({"void"}, {"void <player>", "Kill the given players without FE god"}, function(p)
  635.     local players = argument.getPlayers(p)
  636.     local backpack = localPlayer:FindFirstChildWhichIsA("Backpack")
  637.     local hum = character:FindFirstChildWhichIsA("Humanoid")
  638.     local root = character:FindFirstChild("HumanoidRootPart")
  639.     local point = root.CFrame
  640.    
  641.     if not backpack:FindFirstChildWhichIsA("Tool") then
  642.         lib.messageOut("void", "Cannot bring players, no tools found")
  643.         return
  644.     end
  645.    
  646.     if backpack and hum then
  647.         local tools = getTools(#players+1)
  648.         wait()
  649.         for i, v in pairs(tools) do
  650.             v.Parent = character
  651.         end
  652.         wait()
  653.         for i, v in pairs(tools) do
  654.             v.Parent = workspace
  655.         end
  656.         wait(.2)
  657.         for key, player in pairs(players) do
  658.             local target = player.Character
  659.             if target and player ~= localPlayer then
  660.                 root = character:FindFirstChild("HumanoidRootPart")
  661.                 local assignedTool = tools[key+1]
  662.                 local handle = assignedTool:FindFirstChild("Handle")
  663.                 local targetPart = target:FindFirstChild("HumanoidRootPart")
  664.                 if handle and targetPart then
  665.                     local schar = character
  666.                     repeat
  667.                         RunService.RenderStepped:Wait()
  668.                         root.CFrame = CFrame.new(800, workspace.FallenPartsDestroyHeight + 5, 800)
  669.                         targetPart.CFrame = CFrame.new(root.Position + root.CFrame.rightVector)
  670.                     until
  671.                         assignedTool.Parent ~= workspace or localPlayer.Character ~= schar
  672.                     root.CFrame = CFrame.new(800, workspace.FallenPartsDestroyHeight + 5, 800)
  673.                 end
  674.             end
  675.         end
  676.     end
  677. end)
  678.  
  679. cmd.add({"killall", "toolkillall"}, {"killall", "Kill all players using tools"}, function()
  680.     local players = Players:GetPlayers()
  681.     local backpack = localPlayer:FindFirstChildWhichIsA("Backpack")
  682.     local hum = character:FindFirstChildWhichIsA("Humanoid")
  683.     local root = character:FindFirstChild("HumanoidRootPart")
  684.     local point = root.CFrame
  685.    
  686.     if not backpack:FindFirstChildWhichIsA("Tool") then
  687.         lib.messageOut("killall", "Cannot bring players, no tools found")
  688.         return
  689.     end
  690.    
  691.     if backpack and hum then
  692.         local tools = getTools(#players*3)
  693.         wait()
  694.         for i, v in pairs(tools) do
  695.             v.Grip = v.Grip * CFrame.new(math.random(-16, 16)/8,0,math.random(-16, 16)/8)
  696.             v.Parent = character
  697.         end
  698.         wait()
  699.         for i, v in pairs(tools) do
  700.             v.Parent = workspace
  701.         end
  702.         wait(.2)
  703.         for key, player in pairs(players) do
  704.             local target = player.Character
  705.             if target and player ~= localPlayer then
  706.                 root = character:FindFirstChild("HumanoidRootPart")
  707.                 local assignedTool = tools[key+1]
  708.                 local handle = assignedTool:FindFirstChild("Handle")
  709.                 local targetPart = target:FindFirstChild("HumanoidRootPart")
  710.                 if handle and targetPart then
  711.                     local schar = character
  712.                     wrap(function()
  713.                         repeat
  714.                             RunService.RenderStepped:Wait()
  715.                             root.CFrame = CFrame.new(900, workspace.FallenPartsDestroyHeight+30, 900)
  716.                             targetPart.CFrame = CFrame.new(root.Position + root.CFrame.rightVector)
  717.                         until
  718.                             assignedTool.Parent ~= workspace or localPlayer.Character ~= schar
  719.                         wait(0.4)
  720.                         for i, v in pairs(character:GetDescendants()) do
  721.                             if v:isA("Weld") then
  722.                                 if v.Part0 == handle or v.Part1 == handle then
  723.                                     v:Destroy()
  724.                                 end
  725.                             end
  726.                         end
  727.                     end)
  728.                 end
  729.             end
  730.         end
  731.     end
  732. end)
  733.  
  734. cmd.add({"bringall"}, {"bringall", "Bring all players using tools"}, function()
  735.     local players = Players:GetPlayers()
  736.     local backpack = localPlayer:FindFirstChildWhichIsA("Backpack")
  737.     local hum = character:FindFirstChildWhichIsA("Humanoid")
  738.     local root = character:FindFirstChild("HumanoidRootPart")
  739.     local point = root.CFrame
  740.    
  741.     if not backpack:FindFirstChildWhichIsA("Tool") then
  742.         lib.messageOut("bringall", "Cannot bring players, no tools found")
  743.         return
  744.     end
  745.    
  746.     if backpack and hum then
  747.         local tools = getTools(#players*3)
  748.         wait()
  749.         for i, v in pairs(tools) do
  750.             v.Grip = v.Grip * CFrame.new(math.random(-16, 16)/8,0,math.random(-16, 16)/8)
  751.             v.Parent = character
  752.         end
  753.         wait()
  754.         for i, v in pairs(tools) do
  755.             v.Parent = workspace
  756.         end
  757.         wait(.2)
  758.         for key, player in pairs(players) do
  759.             local target = player.Character
  760.             if target and player ~= localPlayer then
  761.                 root = character:FindFirstChild("HumanoidRootPart")
  762.                 local assignedTool = tools[key+1]
  763.                 local handle = assignedTool:FindFirstChild("Handle")
  764.                 local targetPart = target:FindFirstChild("HumanoidRootPart")
  765.                 if handle and targetPart then
  766.                     local schar = character
  767.                     wrap(function()
  768.                         repeat
  769.                             wait()
  770.                             root.CFrame = point
  771.                             targetPart.CFrame = CFrame.new(root.Position + root.CFrame.rightVector)
  772.                         until
  773.                             assignedTool.Parent ~= workspace or localPlayer.Character ~= schar
  774.                         root.CFrame = point
  775.                     end)
  776.                 end
  777.             end
  778.         end
  779.     end
  780. end)
  781.  
  782. cmd.add({"bring"}, {"bring <player>", "Bring the given player(s)"}, function(p)
  783.     local players = argument.getPlayers(p)
  784.     local backpack = localPlayer:FindFirstChildWhichIsA("Backpack")
  785.     local hum = character:FindFirstChildWhichIsA("Humanoid")
  786.     local root = character:FindFirstChild("HumanoidRootPart")
  787.     local point = root.CFrame
  788.    
  789.     if not backpack:FindFirstChildWhichIsA("Tool") then
  790.         lib.messageOut("bring <player>", "Cannot bring players, no tools found")
  791.         return
  792.     end
  793.    
  794.     if backpack and hum then
  795.         local tools = getTools(#players+1)
  796.         wait()
  797.         for i, v in pairs(tools) do
  798.             v.Parent = character
  799.         end
  800.         wait()
  801.         for i, v in pairs(tools) do
  802.             v.Parent = workspace
  803.         end
  804.         wait()
  805.         for key, player in pairs(players) do
  806.             local target = player.Character
  807.             if target and player ~= localPlayer then
  808.                 root = character:FindFirstChild("HumanoidRootPart")
  809.                 local assignedTool = tools[key+1]
  810.                 local handle = assignedTool:FindFirstChild("Handle")
  811.                 local targetPart = target:FindFirstChild("HumanoidRootPart")
  812.                 if handle and targetPart then
  813.                     local schar = character
  814.                     wrap(function()
  815.                         repeat
  816.                             wait()
  817.                             targetPart.CFrame = handle.CFrame
  818.                             root.CFrame = point
  819.                         until
  820.                             assignedTool.Parent ~= workspace or localPlayer.Character ~= schar
  821.                         for i, v in pairs(character:GetDescendants()) do
  822.                             if v.Name:find("Grip") and v:isA("Weld") then
  823.                                 if v.Part0 == handle or v.Part1 == handle then
  824.                                     v:Destroy()
  825.                                 end
  826.                             end
  827.                         end
  828.                     end)
  829.                 end
  830.             end
  831.         end
  832.     end
  833. end)
  834.  
  835. cmd.add({"chatspam"}, {"chatspam <number>", "Repeatedly chat a massive string <N> at a time"}, function(n)
  836.     local amt = tonumber(n) or 1
  837.     lib.connect("spam", RunService.RenderStepped:Connect(function()
  838.         for i = 1, amt do
  839.             localPlayer:Chat(("💖"):rep(120000))
  840.         end
  841.     end))
  842. end)
  843.  
  844. cmd.add({"errorlag", "animlag", "serverlag"}, {"animlag <number>", "Repeatedly error the server with a massive string <N> at a time"}, function(n)
  845.     local amt = tonumber(n) or 1
  846.     local i = 1234
  847.     local symbols = {"💖","❤️","🔥","👍","🎉","😜","💯","💜","😈","💦"}
  848.     local function err(...)
  849.         i = i + 1
  850.         if i > 30000 then i = 1000 end
  851.         local hum = character:FindFirstChildWhichIsA("Humanoid")
  852.         local animation = Instance.new("Animation")
  853.         animation.AnimationId = (symbols[math.random(1, #symbols)]):rep(i)
  854.         hum:LoadAnimation(animation):Play()
  855.         animation:Destroy()
  856.     end
  857.     lib.connect("spam", RunService.RenderStepped:Connect(function()
  858.         for i = 1, amt do
  859.             err()
  860.         end
  861.     end))
  862. end)
  863.  
  864. cmd.add({"soundspam", "playallsounds"}, {"soundspam", "Repeatedly play all sounds"}, function()
  865.     if SoundService.RespectFilteringEnabled == true then lib.messageOut("soundspam", "Sounds will not replicate") return end
  866.     local sounds = {}
  867.     for i, v in pairs(getinstances and getinstances() or game:GetDescendants()) do
  868.         pcall(function()
  869.             if v:IsA("Sound") and v:IsDescendantOf(workspace) then
  870.                 table.insert(sounds, v)
  871.             end
  872.         end)
  873.     end
  874.     local c = lib.connect("spam", RunService.RenderStepped:Connect(function() end))
  875.     while c.Connected do
  876.         for _, sound in pairs(sounds) do
  877.             sound:Play()
  878.             sound.TimePosition = sound.TimeLength/3
  879.         end
  880.         wait(0.15)
  881.     end
  882. end)
  883.  
  884. cmd.add({"remotespam", "exhaust"}, {"remotespam <number>", "Repeatedly fire all remotes <N> at a time"}, function(n)
  885.     local amt = tonumber(n) or 1
  886.     local events, functions = {}, {}
  887.     local str = ("💖"):rep(120000)
  888.     for i, v in pairs(getinstances and getinstances() or game:GetDescendants()) do
  889.         pcall(function()
  890.             if v.Name:find("%d") == 1 then return end
  891.             if v:IsA("RemoteEvent") then
  892.                 table.insert(events, v)
  893.             elseif v:IsA("RemoteFunction") then
  894.                 table.insert(functions, v)
  895.             end
  896.         end)
  897.     end
  898.     lib.connect("spam", RunService.Stepped:Connect(function()
  899.         for i = 1, amt do
  900.             spawn(function()
  901.                 for _, remote in pairs(events) do
  902.                     remote:FireServer(str)
  903.                 end
  904.                 for _, remote in pairs(functions) do
  905.                     remote:InvokeServer(str)
  906.                 end
  907.             end)
  908.         end
  909.     end))
  910. end)
  911.  
  912. cmd.add({"unspam", "unlag", "unchatspam", "unanimlag", "unremotespam"}, {"unspam", "Stop all attempts to lag/spam"}, function()
  913.     lib.disconnect("spam")
  914. end)
  915.  
  916. cmd.add({"ping", "lag"}, {"ping <ms>", "Set your replication lag to a value"}, function(n)
  917.     local ping = (tonumber(n) or 0)/1000
  918.     settings():GetService("NetworkSettings").IncommingReplicationLag = ping
  919. end)
  920.  
  921. cmd.add({"refresh", "re"}, {"refresh", "Respawn your character and teleport back to your previous position"}, function()
  922.     local cf, p = CFrame.new(), character:FindFirstChild("HumanoidRootPart") or character:FindFirstChild("Head")
  923.     if p then
  924.         cf = p.CFrame
  925.     end
  926.     respawn()
  927.     player.CharacterAdded:Wait(); wait(0.2);
  928.     character:WaitForChild("HumanoidRootPart").CFrame = cf
  929. end)
  930.  
  931. cmd.add({"respawn"}, {"respawn", "Respawn your character"}, function()
  932.     respawn()
  933. end)
  934.  
  935. cmd.add({"trip", "platformstand"}, {"trip", "Trip your player"}, function()
  936.     local hum = character:FindFirstChildWhichIsA("Humanoid")
  937.     local hrp = character:FindFirstChild("HumanoidRootPart")
  938.     if hum then
  939.         if hrp then
  940.             hrp.RotVelocity = Vector3.new(-5, 0, 0)
  941.         end
  942.         hum.PlatformStand = true
  943.     end
  944. end)
  945.  
  946. cmd.add({"stand", "untrip"}, {"stand", "Stand up"}, function()
  947.     local hum = character:FindFirstChildWhichIsA("Humanoid")
  948.     if hum then
  949.         hum.PlatformStand = false
  950.     end
  951. end)
  952.  
  953. cmd.add({"sit"}, {"sit", "Sit your player"}, function()
  954.     local hum = character:FindFirstChildWhichIsA("Humanoid")
  955.     if hum then
  956.         hum.Sit = true
  957.     end
  958. end)
  959.  
  960. cmd.add({"antikill", "nofekill", "antifekill"}, {"antikill", "Toggle FE kill prevention  -Cyrus"}, function()
  961.     -- from cyrus
  962.     if connections["antifekill"] then lib.disconnect("antifekill") return end
  963.     local LP = game:GetService'Players'.LocalPlayer
  964.     local OldCFrame = LP.Character.Head.CFrame
  965.     local debounce = false
  966.     local tools = {}
  967.     for _,v in pairs(LP.Backpack:GetChildren()) do
  968.         if v:IsA'Tool' then
  969.             table.insert(tools,v)
  970.         end
  971.     end
  972.     lib.connect("antifekill", LP.Character.ChildAdded:Connect(function(h)
  973.         for _,v in pairs(tools) do if h == v then return end end
  974.         if h:IsA'Tool' then
  975.             table.insert(tools,h)
  976.             LP.Backpack:FindFirstChildOfClass'Tool'.Parent = LP.Character
  977.             LP.Character:FindFirstChildOfClass'Tool'.Parent = LP.Backpack
  978.             for i = 1,50 do
  979.                 LP.Character.HumanoidRootPart.CFrame = OldCFrame
  980.             end
  981.             debounce = true
  982.             repeat wait(1) until not LP.Character:FindFirstChildOfClass'Tool'
  983.             debounce = false
  984.             if not debounce then
  985.                 OldCFrame = LP.Character.Head.CFrame + Vector3.new(0,5,0)
  986.             end
  987.         end
  988.     end))
  989.    
  990.     lib.connect("antifekill", LP.Character.ChildRemoved:Connect(function(a)
  991.         if a:IsA'Tool' then
  992.             table.insert(tools,a)
  993.         end
  994.     end))
  995. end)
  996.  
  997. cmd.add({"move", "addpos", "translate", "trans"}, {"move <X,Y,Z>", "Moves your character by the given X,Y,Z coordinates"}, function(p)
  998.     local players = argument.getPlayers(p)
  999.     local pos = lib.parseText(p, opt.tupleSeparator)
  1000.     if character then
  1001.         if pos and #pos == 3 then
  1002.             local x,y,z = pos[1], pos[2], pos[3]
  1003.             character:TranslateBy(Vector3.new(x, y, z))
  1004.         end
  1005.     end
  1006. end)
  1007.  
  1008. local flyPart
  1009. cmd.add({"fly"}, {"fly [speed]", "Enable flight"}, function(speed)
  1010.     if not speed then speed = 5 end
  1011.     if connections["fly"] then lib.disconnect("fly") character:FindFirstChildWhichIsA("Humanoid").PlatformStand = false end
  1012.     local dir = {w = false, a = false, s = false, d = false}
  1013.     local cf = Instance.new("CFrameValue")
  1014.    
  1015.     flyPart = flyPart or Instance.new("Part")
  1016.     flyPart.Anchored = true
  1017.     pcall(function()
  1018.         flyPart.CFrame = character.HumanoidRootPart.CFrame
  1019.     end)
  1020.    
  1021.     lib.connect("fly", RunService.RenderStepped:Connect(function()
  1022.         if not character:FindFirstChild("HumanoidRootPart") then return end
  1023.         local primaryPart = character.HumanoidRootPart
  1024.         local humanoid = character:FindFirstChildWhichIsA("Humanoid")
  1025.        
  1026.         local x, y, z = 0, 0, 0
  1027.         if dir.w then z = -1 * speed end
  1028.         if dir.a then x = -1 * speed end
  1029.         if dir.s then z = 1 * speed end
  1030.         if dir.d then x = 1 * speed end
  1031.         if dir.q then y = 1 * speed end
  1032.         if dir.e then y = -1 * speed end
  1033.        
  1034.         for i, v in pairs(character:GetDescendants()) do
  1035.             if v:IsA("BasePart") then
  1036.                 v.Velocity = Vector3.new(0, 0, 0)
  1037.                 v.RotVelocity = Vector3.new(0, 0, 0)
  1038.             end
  1039.         end
  1040.         flyPart.CFrame = CFrame.new(
  1041.             flyPart.CFrame.p,
  1042.             (camera.CFrame * CFrame.new(0, 0, -100)).p
  1043.         )
  1044.        
  1045.         local moveDir = CFrame.new(x,y,z)
  1046.         cf.Value = cf.Value:lerp(moveDir, 0.2)
  1047.         flyPart.CFrame = flyPart.CFrame:lerp(flyPart.CFrame * cf.Value, 0.2)
  1048.         primaryPart.CFrame = flyPart.CFrame
  1049.         humanoid.PlatformStand = true
  1050.     end))
  1051.     lib.connect("fly", UserInputService.InputBegan:Connect(function(input, event)
  1052.         if event then return end
  1053.         local code, codes = input.KeyCode, Enum.KeyCode
  1054.         if code == codes.W then
  1055.             dir.w = true
  1056.         elseif code == codes.A then
  1057.             dir.a = true
  1058.         elseif code == codes.S then
  1059.             dir.s = true
  1060.         elseif code == codes.D then
  1061.             dir.d = true
  1062.         elseif code == codes.Q then
  1063.             dir.q = true
  1064.         elseif code == codes.E then
  1065.             dir.e = true
  1066.         elseif code == codes.Space then
  1067.             dir.q = true
  1068.         end
  1069.     end))
  1070.     lib.connect("fly", UserInputService.InputEnded:Connect(function(input, event)
  1071.         if event then return end
  1072.         local code, codes = input.KeyCode, Enum.KeyCode
  1073.         if code == codes.W then
  1074.             dir.w = false
  1075.         elseif code == codes.A then
  1076.             dir.a = false
  1077.         elseif code == codes.S then
  1078.             dir.s = false
  1079.         elseif code == codes.D then
  1080.             dir.d = false
  1081.         elseif code == codes.Q then
  1082.             dir.q = false
  1083.         elseif code == codes.E then
  1084.             dir.e = false
  1085.         elseif code == codes.Space then
  1086.             dir.q = false
  1087.         end
  1088.     end))
  1089. end)
  1090. cmd.add({"unfly"}, {"unfly", "Disable flight"}, function()
  1091.     lib.disconnect("fly")
  1092.     flyPart:Destroy()
  1093.     character:FindFirstChildWhichIsA("Humanoid").PlatformStand = false
  1094. end)
  1095.  
  1096. cmd.add({"noclip", "nclip", "nc"}, {"noclip", "Disable your player's collision"}, function()
  1097.     if connections["noclip"] then lib.disconnect("noclip") return end
  1098.     lib.connect("noclip", RunService.Stepped:Connect(function()
  1099.         if not character then return end
  1100.         for i, v in pairs(character:GetDescendants()) do
  1101.             if v:IsA("BasePart") then
  1102.                 v.CanCollide = false
  1103.             end
  1104.         end
  1105.     end))
  1106. end)
  1107. cmd.add({"clip", "c"}, {"clip", "Enable your player's collision"}, function()
  1108.     lib.disconnect("noclip")
  1109. end)
  1110.  
  1111. cmd.add({"freecam", "fc", "fcam"}, {"freecam [speed]", "Enable free camera"}, function(speed)
  1112.     if not speed then speed = 5 end
  1113.     if connections["freecam"] then lib.disconnect("freecam") camera.CameraSubject = character   wrap(function() character.PrimaryPart.Anchored = false end) end
  1114.     local dir = {w = false, a = false, s = false, d = false}
  1115.     local cf = Instance.new("CFrameValue")
  1116.     local camPart = Instance.new("Part")
  1117.     camPart.Transparency = 1
  1118.     camPart.Anchored = true
  1119.     camPart.CFrame = camera.CFrame
  1120.     wrap(function()
  1121.         character.PrimaryPart.Anchored = true
  1122.     end)
  1123.    
  1124.     lib.connect("freecam", RunService.RenderStepped:Connect(function()
  1125.         local primaryPart = camPart
  1126.         camera.CameraSubject = primaryPart
  1127.        
  1128.         local x, y, z = 0, 0, 0
  1129.         if dir.w then z = -1 * speed end
  1130.         if dir.a then x = -1 * speed end
  1131.         if dir.s then z = 1 * speed end
  1132.         if dir.d then x = 1 * speed end
  1133.         if dir.q then y = 1 * speed end
  1134.         if dir.e then y = -1 * speed end
  1135.        
  1136.         primaryPart.CFrame = CFrame.new(
  1137.             primaryPart.CFrame.p,
  1138.             (camera.CFrame * CFrame.new(0, 0, -100)).p
  1139.         )
  1140.        
  1141.         local moveDir = CFrame.new(x,y,z)
  1142.         cf.Value = cf.Value:lerp(moveDir, 0.2)
  1143.         primaryPart.CFrame = primaryPart.CFrame:lerp(primaryPart.CFrame * cf.Value, 0.2)
  1144.     end))
  1145.     lib.connect("freecam", UserInputService.InputBegan:Connect(function(input, event)
  1146.         if event then return end
  1147.         local code, codes = input.KeyCode, Enum.KeyCode
  1148.         if code == codes.W then
  1149.             dir.w = true
  1150.         elseif code == codes.A then
  1151.             dir.a = true
  1152.         elseif code == codes.S then
  1153.             dir.s = true
  1154.         elseif code == codes.D then
  1155.             dir.d = true
  1156.         elseif code == codes.Q then
  1157.             dir.q = true
  1158.         elseif code == codes.E then
  1159.             dir.e = true
  1160.         elseif code == codes.Space then
  1161.             dir.q = true
  1162.         end
  1163.     end))
  1164.     lib.connect("freecam", UserInputService.InputEnded:Connect(function(input, event)
  1165.         if event then return end
  1166.         local code, codes = input.KeyCode, Enum.KeyCode
  1167.         if code == codes.W then
  1168.             dir.w = false
  1169.         elseif code == codes.A then
  1170.             dir.a = false
  1171.         elseif code == codes.S then
  1172.             dir.s = false
  1173.         elseif code == codes.D then
  1174.             dir.d = false
  1175.         elseif code == codes.Q then
  1176.             dir.q = false
  1177.         elseif code == codes.E then
  1178.             dir.e = false
  1179.         elseif code == codes.Space then
  1180.             dir.q = false
  1181.         end
  1182.     end))
  1183. end)
  1184. cmd.add({"unfreecam", "unfc", "unfcam"}, {"unfreecam", "Disable free camera"}, function()
  1185.     lib.disconnect("freecam")
  1186.     camera.CameraSubject = character
  1187.     wrap(function()
  1188.         character.PrimaryPart.Anchored = false
  1189.     end)
  1190. end)
  1191.  
  1192. cmd.add({"drophats"}, {"drophats", "Drop all of your hats"}, function()
  1193.     for _, hat in pairs(character:GetChildren()) do
  1194.         if hat:IsA("Accoutrement") then
  1195.             hat.Parent = workspace
  1196.         end
  1197.     end
  1198. end)
  1199.  
  1200. cmd.add({"hatspin"}, {"hatspin <height>", "Make your hats spin"}, function(h)
  1201.     local head = character:FindFirstChild("Head")
  1202.     if not head then return end
  1203.     for _, hat in pairs(character:GetChildren()) do
  1204.         if hat:IsA("Accoutrement") and hat:FindFirstChild("Handle") then
  1205.             local handle = hat.Handle
  1206.             handle:BreakJoints()
  1207.            
  1208.             local align = Instance.new("AlignPosition")
  1209.             local a0, a1 = Instance.new("Attachment"), Instance.new("Attachment")
  1210.             align.Attachment0, align.Attachment1 = a0, a1
  1211.             align.RigidityEnabled = true
  1212.             a1.Position = Vector3.new(0, tonumber(h) or 0.5, 0)
  1213.             lock(align, handle); lock(a0, handle); lock(a1, head);
  1214.            
  1215.             local angular = Instance.new("BodyAngularVelocity")
  1216.             angular.AngularVelocity = Vector3.new(0, math.random(100, 160)/16, 0)
  1217.             angular.MaxTorque = Vector3.new(0, 400000, 0)
  1218.             lock(angular, handle);
  1219.         end
  1220.     end
  1221. end)
  1222.  
  1223. cmd.add({"hatorbit"}, {"hatorbit [height] [distance]", "Make your hats orbit around your head"}, function(h, d)
  1224.     local head = character:FindFirstChild("Head")
  1225.     if not head then return end
  1226.     local i = 3
  1227.     for _, hat in pairs(character:GetChildren()) do
  1228.         if hat:IsA("Accoutrement") and hat:FindFirstChild("Handle") then
  1229.             local handle = hat.Handle
  1230.             handle:BreakJoints()
  1231.            
  1232.             local align = Instance.new("AlignPosition")
  1233.             local a0, a1 = Instance.new("Attachment"), Instance.new("Attachment")
  1234.             align.Attachment0, align.Attachment1 = a0, a1
  1235.             align.RigidityEnabled = true
  1236.             lock(align, handle); lock(a0, handle); lock(a1, head);
  1237.             i = i + 0.5
  1238.             local n = tonumber(d) or i
  1239.             wrap(function()
  1240.                 local rotX, rotY = 0, math.pi/2
  1241.                 local speed = math.random(25, 100)/1000
  1242.                 while handle and handle.Parent do
  1243.                     rotX, rotY = rotX + speed, rotY + speed
  1244.                     a1.Position = Vector3.new(math.sin(rotX) * (n), tonumber(h) or 0, math.sin(rotY) * (n))
  1245.                     RunService.RenderStepped:Wait(0)
  1246.                 end
  1247.             end)
  1248.         end
  1249.     end
  1250. end)
  1251.  
  1252. cmd.add({"limbbounce"}, {"limbbounce [height] [distance]", "Make your limbs bounce around your head"}, function(h, d)
  1253.     local head = character:FindFirstChild("Head")
  1254.     if not head then return end
  1255.     local i = 2
  1256.     for _, part in pairs(character:GetDescendants()) do
  1257.         local name = part.Name:lower()
  1258.         if part:IsA("BasePart") and not part.Parent:IsA("Accoutrement") and not name:find("torso") and not name:find("head") and not name:find("root") then
  1259.             i = i + math.random(15,50)/100
  1260.             part:BreakJoints()
  1261.             local n = tonumber(d) or i
  1262.            
  1263.             local align = Instance.new("AlignPosition")
  1264.             local a0, a1 = Instance.new("Attachment"), Instance.new("Attachment")
  1265.             align.Attachment0, align.Attachment1 = a0, a1
  1266.             align.RigidityEnabled = true
  1267.             lock(align, part); lock(a0, part); lock(a1, head);
  1268.            
  1269.             wrap(function()
  1270.                 local rotX = 0
  1271.                 local speed = math.random(350, 750)/10000
  1272.                 while part and part.Parent do
  1273.                     rotX = rotX + speed
  1274.                     a1.Position = Vector3.new(0, (tonumber(h) or 0) + math.sin(rotX) * n, 0)
  1275.                     RunService.RenderStepped:Wait(0)
  1276.                 end
  1277.             end)
  1278.         end
  1279.     end
  1280. end)
  1281.  
  1282. cmd.add({"limborbit"}, {"limborbit [height] [distance]", "Make your limbs orbit around your head"}, function(h, d)
  1283.     local head = character:FindFirstChild("Head")
  1284.     if not head then return end
  1285.     local i = 2
  1286.     for _, part in pairs(character:GetDescendants()) do
  1287.         local name = part.Name:lower()
  1288.         if part:IsA("BasePart") and not part.Parent:IsA("Accoutrement") and not name:find("torso") and not name:find("head") and not name:find("root") then
  1289.             i = i + math.random(15,50)/100
  1290.             part:BreakJoints()
  1291.             local n = tonumber(d) or i
  1292.            
  1293.             local align = Instance.new("AlignPosition")
  1294.             local a0, a1 = Instance.new("Attachment"), Instance.new("Attachment")
  1295.             align.Attachment0, align.Attachment1 = a0, a1
  1296.             align.RigidityEnabled = true
  1297.             lock(align, part); lock(a0, part); lock(a1, head);
  1298.            
  1299.             wrap(function()
  1300.                 local rotX, rotY = 0, math.pi/2
  1301.                 local speed = math.random(35, 75)/1000
  1302.                 while part and part.Parent do
  1303.                     rotX, rotY = rotX + speed, rotY + speed
  1304.                     a1.Position = Vector3.new(math.sin(rotX) * (n), tonumber(h) or 0, math.sin(rotY) * (n))
  1305.                     RunService.RenderStepped:Wait(0)
  1306.                 end
  1307.             end)
  1308.         end
  1309.     end
  1310. end)
  1311.  
  1312. local function getAllTools()
  1313.     local tools = {}
  1314.     local backpack = localPlayer:FindFirstChildWhichIsA("Backpack")
  1315.     if backpack then
  1316.         for i, v in pairs(backpack:GetChildren()) do
  1317.             if v:IsA("Tool") then
  1318.                 table.insert(tools, v)
  1319.             end
  1320.         end
  1321.     end
  1322.     for i, v in pairs(character:GetChildren()) do
  1323.         if v:IsA("Tool") then
  1324.             table.insert(tools, v)
  1325.         end
  1326.     end
  1327.     return tools
  1328. end
  1329.  
  1330. cmd.add({"circlemath", "cm"}, {"circlemath <mode> <size>", "Gay circle math\nModes: abc..."}, function(mode, size)
  1331.     local mode = mode or "a"
  1332.     local backpack = localPlayer:FindFirstChildWhichIsA("Backpack")
  1333.     lib.disconnect("cm")
  1334.     if backpack and character.Parent then
  1335.         local tools = getAllTools()
  1336.         for i, tool in pairs(tools) do
  1337.             local cpos, g = (math.pi*2)*(i/#tools), CFrame.new()
  1338.             local tcon = {}
  1339.             tool.Parent = backpack
  1340.            
  1341.             if mode == "a" then
  1342.                 size = tonumber(size) or 2
  1343.                 g = (
  1344.                     CFrame.new(0, 0, size)*
  1345.                     CFrame.Angles(rad(90), 0, cpos)
  1346.                 )
  1347.             elseif mode == "b" then
  1348.                 size = tonumber(size) or 2
  1349.                 g = (
  1350.                     CFrame.new(i - #tools/2, 0, 0)*
  1351.                     CFrame.Angles(rad(90), 0, 0)
  1352.                 )
  1353.             elseif mode == "c" then
  1354.                 size = tonumber(size) or 2
  1355.                 g = (
  1356.                     CFrame.new(cpos/3, 0, 0)*
  1357.                     CFrame.Angles(rad(90), 0, cpos*2)
  1358.                 )
  1359.             elseif mode == "d" then
  1360.                 size = tonumber(size) or 2
  1361.                 g = (
  1362.                     CFrame.new(clamp(tan(cpos), -3, 3), 0, 0)*
  1363.                     CFrame.Angles(rad(90), 0, cpos)
  1364.                 )
  1365.             elseif mode == "e" then
  1366.                 size = tonumber(size) or 2
  1367.                 g = (
  1368.                     CFrame.new(0, 0, clamp(tan(cpos), -5, 5))*
  1369.                     CFrame.Angles(rad(90), 0, cpos)
  1370.                 )
  1371.             end
  1372.             tool.Grip = g
  1373.             tool.Parent = character
  1374.            
  1375.             tcon[#tcon] = lib.connect("cm", mouse.Button1Down:Connect(function()
  1376.                 tool:Activate()
  1377.             end))
  1378.             tcon[#tcon] = lib.connect("cm", tool.Changed:Connect(function(p)
  1379.                 if p == "Grip" and tool.Grip ~= g then
  1380.                     tool.Grip = g
  1381.                 end
  1382.             end))
  1383.            
  1384.             lib.connect("cm", tool.AncestryChanged:Connect(function()
  1385.                 for i = 1, #tcon do
  1386.                     tcon[i]:Disconnect()
  1387.                 end
  1388.             end))
  1389.         end
  1390.     end
  1391. end)
  1392.  
  1393. local r = math.rad
  1394. local center = CFrame.new(1.5, 0.5, -1.5)
  1395.  
  1396. cmd.add({"toolanimate"}, {"toolanimate <mode> <int>", "Make your tools epic\nModes: ufo/ring/shutter/saturn/portal/wtf/ball/tor"}, function(mode, int)
  1397.     lib.disconnect("tooldance")
  1398.     local int = tonumber(int) or 5
  1399.     local backpack = localPlayer:FindFirstChildWhichIsA("Backpack")
  1400.     local primary = character:FindFirstChild("HumanoidRootPart")
  1401.     if backpack and primary then
  1402.         local tools = getAllTools()
  1403.         for i, tool in pairs(tools) do
  1404.             if tool:IsA("Tool") and tool:FindFirstChild("Handle") then
  1405.                 local circ = (i/#tools)*(math.pi*2)
  1406.                
  1407.                 local function editGrip(tool, cframe, offset)
  1408.                     local origin = CFrame.new(cframe.p):inverse()
  1409.                     local x, y, z = cframe:toEulerAnglesXYZ()
  1410.                     local new = CFrame.Angles(x, y, z)
  1411.                     local grip = (origin * new):inverse()
  1412.                     tool.Parent = backpack
  1413.                     tool.Grip = offset * grip
  1414.                     tool.Parent = character
  1415.                    
  1416.                     for i, v in pairs(tool:GetDescendants()) do
  1417.                         if v:IsA("Sound") then
  1418.                             v:Stop()
  1419.                         end
  1420.                     end
  1421.                 end
  1422.                 tool.Handle.Massless = true
  1423.                
  1424.                 if mode == "ufo" then
  1425.                     local s = {}
  1426.                     local x, y = i, i + math.pi / 2
  1427.                     lib.connect("tooldance", RunService.Heartbeat:Connect(function()
  1428.                         s.x = math.sin(x)
  1429.                         s.y = math.sin(y)
  1430.                         x, y = x + 0.1, y + 0.1
  1431.                        
  1432.                         local cframe =
  1433.                             center *
  1434.                             CFrame.new() *
  1435.                             CFrame.Angles(r(s.y*10), circ + r(s.y*8), r(s.x*10))
  1436.                         local offset =
  1437.                             CFrame.new(int, 0, 0) *
  1438.                             CFrame.Angles(0, 0, 0)
  1439.                         editGrip(tool, cframe, offset)
  1440.                     end))
  1441.                 elseif mode == "ring" then
  1442.                     local s = {}
  1443.                     local x, y = i, i + math.pi / 2
  1444.                     lib.connect("tooldance", RunService.Heartbeat:Connect(function()
  1445.                         s.x = math.sin(x)
  1446.                         s.y = math.sin(y)
  1447.                         x, y = x + 0.04, y + 0.04
  1448.                        
  1449.                         local cframe =
  1450.                             center *
  1451.                             CFrame.new(0, 3, 0) *
  1452.                             CFrame.Angles(0, circ, x)
  1453.                         local offset =
  1454.                             CFrame.new(0, 0, int) *
  1455.                             CFrame.Angles(0, 0, 0)
  1456.                         editGrip(tool, cframe, offset)
  1457.                     end))
  1458.                 elseif mode == "shutter" then
  1459.                     local s = {}
  1460.                     local x, y = 0, math.pi / 2
  1461.                     lib.connect("tooldance", RunService.Heartbeat:Connect(function()
  1462.                         s.x = math.sin(x)
  1463.                         s.y = math.sin(y)
  1464.                         x, y = x + 0.1, y + 0.1
  1465.                        
  1466.                         local cframe =
  1467.                             center *
  1468.                             CFrame.new(0, 0, 0) *
  1469.                             CFrame.Angles(0, 0, circ + 0)
  1470.                         local offset =
  1471.                             CFrame.new(s.y*6, 0, int) *
  1472.                             CFrame.Angles(r(-90), 0, 0)
  1473.                         editGrip(tool, cframe, offset)
  1474.                     end))
  1475.                 elseif mode == "saturn" then
  1476.                     local s = {}
  1477.                     local x, y = 0, math.pi / 2
  1478.                     lib.connect("tooldance", RunService.Heartbeat:Connect(function()
  1479.                         s.x = math.sin(x)
  1480.                         s.y = math.sin(y)
  1481.                         x, y = x + 0.1, y + 0.1
  1482.                         local cframe =
  1483.                             center *
  1484.                             CFrame.new(0, 0, 0) *
  1485.                             CFrame.Angles(0, circ, 0)
  1486.                         local offset =
  1487.                             CFrame.new(s.y*6, 0, int) *
  1488.                             CFrame.Angles(0, 0, r(0))
  1489.                         editGrip(tool, cframe, offset)
  1490.                     end))
  1491.                 elseif mode == "portal" then
  1492.                     local s = {}
  1493.                     local x, y = 0, math.pi / 2
  1494.                     lib.connect("tooldance", RunService.Heartbeat:Connect(function()
  1495.                         s.x = math.sin(x)
  1496.                         s.y = math.sin(y)
  1497.                         x, y = x + 0.1, y + 0.1
  1498.                        
  1499.                         local cframe =
  1500.                             center *
  1501.                             CFrame.new(0, 0, 0) *
  1502.                             CFrame.Angles(0, 0, circ + r(x*45))
  1503.                         local offset =
  1504.                             CFrame.new(3, 0, int) *
  1505.                             CFrame.Angles(r(-90), 0, 0)
  1506.                         editGrip(tool, cframe, offset)
  1507.                     end))
  1508.                 elseif mode == "ball" then
  1509.                     local s = {}
  1510.                     local n = math.random()*#tools
  1511.                     local x, y = n, n+math.pi / 2
  1512.                     local random = math.random()
  1513.                     lib.connect("tooldance", RunService.Heartbeat:Connect(function()
  1514.                         s.x = math.sin(x)
  1515.                         s.y = math.sin(y)
  1516.                         x, y = x + 0.1, y + 0.1
  1517.                         local cframe =
  1518.                             center *
  1519.                             CFrame.new(0, 0, 0) *
  1520.                             CFrame.Angles(r(y*25), circ, r(y*25))
  1521.                         local offset =
  1522.                             CFrame.new(0, int + random*2, 0) *
  1523.                             CFrame.Angles(r(x*15), 0, 0)
  1524.                         editGrip(tool, cframe, offset)
  1525.                     end))
  1526.                 elseif mode == "wtf" then
  1527.                     local s = {}
  1528.                     local x, y = math.random()^3, math.random()^3+math.pi / 2
  1529.                     lib.connect("tooldance", RunService.Heartbeat:Connect(function()
  1530.                         s.x = math.sin(x)
  1531.                         s.y = math.sin(y)
  1532.                         x, y = x + 0.1 + math.random()/10, y + 0.1 + math.random()/10
  1533.                         local cframe =
  1534.                             center *
  1535.                             CFrame.new(0, 0, 0) *
  1536.                             CFrame.Angles(r(y*100)+math.random(), circ, r(y*100)+math.random())
  1537.                         local offset =
  1538.                             CFrame.new(0, int + math.random()*4, 0) *
  1539.                             CFrame.Angles(r(x*100), 0, 0)
  1540.                         editGrip(tool, cframe, offset)
  1541.                     end))
  1542.                 elseif mode == "tor" then
  1543.                     local s = {}
  1544.                     local x, y = i*1, i*1+math.pi / 2
  1545.                     local random = math.random()
  1546.                     lib.connect("tooldance", RunService.Heartbeat:Connect(function()
  1547.                         s.x = math.sin(x)
  1548.                         s.y = math.sin(y)
  1549.                         x, y = x + (int/75), y+0.1
  1550.                         local cframe =
  1551.                             center *
  1552.                             CFrame.new(1.5, 2, 0) *
  1553.                             CFrame.Angles(r(-90-25), 0, 0)
  1554.                         local offset =
  1555.                             CFrame.new(0, s.x*3, -int+math.sin(y/5)*-int) *
  1556.                             CFrame.Angles(r(int), s.x, -x)
  1557.                         editGrip(tool, cframe, offset)
  1558.                     end))
  1559.                 end
  1560.             else
  1561.                 table.remove(tools, i)
  1562.             end
  1563.         end
  1564.     end
  1565. end)
  1566.  
  1567. cmd.add({"tooldance", "td"}, {"tooldance <mode> <size>", "Make your tools dance\nModes: tor/sph/inf/rng/whl/wht/voi"}, function(mode, size)
  1568.     local size = tonumber(size) or 5
  1569.     lib.disconnect("tooldance")
  1570.     local backpack = localPlayer:FindFirstChildWhichIsA("Backpack")
  1571.     local primary = character:FindFirstChild("HumanoidRootPart")
  1572.     if backpack and primary then
  1573.         local i, tools = 0, getAllTools()
  1574.         for _, tool in pairs(tools) do
  1575.             if tool:IsA("Tool") and tool:FindFirstChild("Handle") then
  1576.                 i=i+1
  1577.                 tool.Parent = character
  1578.                 local n = i
  1579.                 local grip = character:FindFirstChild("RightGrip", true)
  1580.                 local arm = grip.Parent
  1581.                
  1582.                 local function editGrip(cf)
  1583.                     tool.Parent = backpack
  1584.                     tool.Grip = cf
  1585.                     tool.Parent = character
  1586.                    
  1587.                     for i, v in pairs(tool:GetDescendants()) do
  1588.                         if v:IsA("Sound") and v.Name:find("sheath") then
  1589.                             v:Destroy()
  1590.                         end
  1591.                     end
  1592.                 end
  1593.                 tool.Handle.Massless = true
  1594.                
  1595.                 if mode == "tor" then
  1596.                     local x, y = n, n+math.pi/2
  1597.                     lib.connect("tooldance", RunService.RenderStepped:Connect(function()
  1598.                         x,y = x+(size/75),y+0.1
  1599.                         local sx,sy = math.sin(x),math.sin(y)
  1600.                         editGrip(
  1601.                             CFrame.new(
  1602.                                 Vector3.new(0, math.sin(x * 0.5), size + 3 + math.sin(y / 5) * size)
  1603.                             ) *
  1604.                             CFrame.Angles(
  1605.                                 math.rad(size),
  1606.                                 math.sin(x),
  1607.                                 -x
  1608.                             )
  1609.                         )
  1610.                     end))
  1611.                 elseif mode == "sph" then
  1612.                     local x, y = n, n+math.pi/2
  1613.                     lib.connect("tooldance", RunService.RenderStepped:Connect(function()
  1614.                         x,y = x+.1,y+.1
  1615.                         local sx,sy = math.sin(x),math.sin(y)
  1616.                         editGrip(
  1617.                             CFrame.new(
  1618.                                 Vector3.new(0, size, 0)
  1619.                             ) *
  1620.                             CFrame.Angles(
  1621.                                 math.deg(x/150),
  1622.                                 x + rad(90),
  1623.                                 0
  1624.                             )
  1625.                         )
  1626.                     end))
  1627.                 elseif mode == "inf" then
  1628.                     local x, y = n, n+math.pi/2
  1629.                     lib.connect("tooldance", RunService.RenderStepped:Connect(function()
  1630.                         x,y = x+.1,y+.1
  1631.                         local sx,sy = math.sin(x),math.sin(y)
  1632.                         editGrip(
  1633.                             CFrame.new(
  1634.                                 Vector3.new(0, size, 0)
  1635.                             ) *
  1636.                             CFrame.Angles(
  1637.                                 x,
  1638.                                 x + rad(90),
  1639.                                 0
  1640.                             )
  1641.                         )
  1642.                     end))
  1643.                 elseif mode == "wht" then
  1644.                     local x, y = n, n+math.pi/2
  1645.                     lib.connect("tooldance", RunService.RenderStepped:Connect(function()
  1646.                         x,y = x+.1,y+.1
  1647.                         local sx,sy = math.sin(x),math.sin(y)
  1648.                         editGrip(
  1649.                             CFrame.new(
  1650.                                 Vector3.new(0, size, 0)
  1651.                             ) *
  1652.                             CFrame.Angles(
  1653.                                 (y+math.sin(x)*10)/10,
  1654.                                 x + rad(90),
  1655.                                 0
  1656.                             )
  1657.                         )
  1658.                     end))
  1659.                 elseif mode == "rng" then
  1660.                     local x, y = n, n+math.pi/2
  1661.                     lib.connect("tooldance", RunService.RenderStepped:Connect(function()
  1662.                         x,y = x+0.1,y+0.1
  1663.                         local sx,sy = math.sin(x),math.sin(y)
  1664.                         editGrip(
  1665.                             CFrame.new(
  1666.                                 0, 0, size
  1667.                             ) *
  1668.                             CFrame.Angles(
  1669.                                 0,
  1670.                                 x,
  1671.                                 0
  1672.                             )
  1673.                         )
  1674.                     end))
  1675.                 elseif mode == "whl" then
  1676.                     local x, y = n, n+math.pi/2
  1677.                     lib.connect("tooldance", RunService.RenderStepped:Connect(function()
  1678.                         x,y = x+0.1,y+0.1
  1679.                         local sx,sy = math.sin(x),math.sin(y)
  1680.                         editGrip(
  1681.                             CFrame.new(
  1682.                                 Vector3.new(0, 0, size)
  1683.                             ) *
  1684.                             CFrame.Angles(
  1685.                                 x,
  1686.                                 0,
  1687.                                 0
  1688.                             )
  1689.                         )
  1690.                     end))
  1691.                 elseif mode == "voi" then
  1692.                     local x, y = n, n+math.pi/2
  1693.                     lib.connect("tooldance", RunService.RenderStepped:Connect(function()
  1694.                         x,y = x+0.1,y+0.1
  1695.                         local sx,sy = math.sin(x),math.sin(y)
  1696.                         editGrip(
  1697.                             CFrame.new(
  1698.                                 Vector3.new(size, 0, 0)
  1699.                             ) *
  1700.                             CFrame.Angles(
  1701.                                 0,
  1702.                                 .6 + sy/3,
  1703.                                 (n) + sx + x
  1704.                             )
  1705.                         )
  1706.                     end))
  1707.                 end
  1708.             end
  1709.         end
  1710.     end
  1711. end)
  1712. cmd.add({"nodance", "untooldance"}, {"nodance", "Stop making tools dance"}, function()
  1713.     lib.disconnect("tooldance")
  1714. end)
  1715.  
  1716. cmd.add({"toolvis", "audiovis"}, {"toolvis <size>", "Turn your tools into an audio visualizer"}, function(size)
  1717.     lib.disconnect("tooldance")
  1718.     local backpack = localPlayer:FindFirstChildWhichIsA("Backpack")
  1719.     local primary = character:FindFirstChild("HumanoidRootPart")
  1720.     local hum = character:FindFirstChild("Humanoid")
  1721.     local sound
  1722.     for i, v in pairs(character:GetDescendants()) do
  1723.         if v:IsA("Sound") and v.Playing then
  1724.             sound = v
  1725.         end
  1726.     end
  1727.     if backpack and primary and sound then
  1728.         local tools = getAllTools()
  1729.         local t = 0
  1730.         for i, tool in pairs(tools) do
  1731.             if tool.Parent == character and tool:IsA("BackpackItem") and tool:FindFirstChildWhichIsA("BasePart") and tool.Parent == character then
  1732.                 local grip = character:FindFirstChild("RightGrip", true)
  1733.                 local oldParent = grip.Parent
  1734.                 lib.connect("tooldance", RunService.RenderStepped:Connect(function()
  1735.                     if not sound then lib.disconnect("tooldance") end
  1736.                     tool.Parent = character
  1737.                     grip.Parent = oldParent
  1738.                 end))
  1739.             end
  1740.         end
  1741.         wait()
  1742.         for i, tool in pairs(tools) do
  1743.             if tool.Parent == backpack and tool:IsA("BackpackItem") and tool:FindFirstChildWhichIsA("BasePart") then
  1744.                 t = t + 1
  1745.                 tool.Parent = character
  1746.                 local n = i
  1747.                 local grip = character:FindFirstChild("RightGrip", true)
  1748.                 local arm = grip.Parent
  1749.                
  1750.                 local function editGrip(cf)
  1751.                     tool.Parent = backpack
  1752.                     tool.Grip = tool.Grip:lerp(cf, 0.2)
  1753.                     tool.Parent = character
  1754.                     for i, v in pairs(tool:GetDescendants()) do
  1755.                         if v:IsA("Sound") then
  1756.                             v.Parent = nil
  1757.                         end
  1758.                     end
  1759.                 end
  1760.                 tool.Handle.Massless = true
  1761.                
  1762.                 local x,y,z,a = n,n+math.pi/2,n,0
  1763.                 lib.connect("tooldance", RunService.Heartbeat:Connect(function()
  1764.                     if not sound then lib.disconnect("tooldance") end
  1765.                    
  1766.                     local mt, loudness = sound.PlaybackLoudness/100, sound.PlaybackLoudness
  1767.                     local sx, sy, sz, sa = math.sin(x), math.sin(y), math.sin(z), math.sin(a)
  1768.                     x,y,z,a = x + 0.22 + mt / 100,  y + sx + mt,  z + sx/10,  a + mt/100 + math.sin(x-n)/100
  1769.                     editGrip(
  1770.                         CFrame.new(
  1771.                             Vector3.new(
  1772.                                 0,
  1773.                                 2 + ((sx/2) * (mt^3/15))/3 - ((sx+0.5)/1.5 * ((loudness/10)^2/400)),
  1774.                                 tonumber(size) or 7
  1775.                             )
  1776.                         ) *
  1777.                         CFrame.Angles(
  1778.                             math.rad((sz+1)/2)*5,
  1779.                             ((math.pi*2)*(n/t)) - (a),
  1780.                             math.rad(sx)*5
  1781.                         )
  1782.                     )
  1783.                 end))
  1784.             end
  1785.         end
  1786.     end
  1787. end)
  1788.  
  1789. cmd.add({"toolspin"}, {"toolspin [height] [amount]", "Make your tools spin on your head"}, function(h, amt)
  1790.     if not amt then amt = 1000 end
  1791.     local head = character:FindFirstChild("Head")
  1792.     if not head then return end
  1793.     for i, tool in pairs(localPlayer.Backpack:GetChildren()) do
  1794.         if tool:IsA("Tool") and tool:FindFirstChild("Handle") then
  1795.             if i >= (tonumber(amt) or 1000) then break end
  1796.             if tool:FindFirstChildWhichIsA("LocalScript") then
  1797.                 tool:FindFirstChildWhichIsA("LocalScript").Disabled = true
  1798.             end
  1799.             tool.Parent = character
  1800.         end
  1801.     end
  1802.     wait(0.5)
  1803.     for _, tool in pairs(character:GetChildren()) do
  1804.         if tool:IsA("Tool") then
  1805.             wrap(function()
  1806.                 tool:WaitForChild("Handle")
  1807.                 for i, part in pairs(tool:GetDescendants()) do
  1808.                     if part:IsA("BasePart") then
  1809.                         part:BreakJoints()
  1810.                        
  1811.                         local align = Instance.new("AlignPosition")
  1812.                         local a0, a1 = Instance.new("Attachment"), Instance.new("Attachment")
  1813.                         align.Attachment0, align.Attachment1 = a0, a1
  1814.                         align.RigidityEnabled = true
  1815.                         a1.Position = Vector3.new(0, tonumber(h) or 0, 0)
  1816.                         lock(align, part); lock(a0, part); lock(a1, head);
  1817.                        
  1818.                         local angular = Instance.new("BodyAngularVelocity")
  1819.                         angular.AngularVelocity = Vector3.new(0, math.random(100, 160)/16, 0)
  1820.                         angular.MaxTorque = Vector3.new(0, 400000, 0)
  1821.                         lock(angular, part);
  1822.                        
  1823.                         spawn(function()
  1824.                             repeat wait() until tool.Parent ~= character
  1825.                             angular:Destroy()
  1826.                             align:Destroy()
  1827.                         end)
  1828.                     end
  1829.                 end
  1830.             end)
  1831.         end
  1832.     end
  1833. end)
  1834.  
  1835. cmd.add({"toolorbit"}, {"toolorbit [height] [distance] [amount]", "Make your tools orbit around your head"}, function(h, d, amt)
  1836.     if not amt then amt = 1000 end
  1837.     local head = character:FindFirstChild("Head")
  1838.     if not head then return end
  1839.     for i, tool in pairs(localPlayer.Backpack:GetChildren()) do
  1840.         if tool:IsA("Tool") and tool:FindFirstChild("Handle") then
  1841.             if i >= (tonumber(amt) or 1000) then break end
  1842.             if tool:FindFirstChildWhichIsA("LocalScript") then
  1843.                 tool:FindFirstChildWhichIsA("LocalScript").Disabled = true
  1844.             end
  1845.             tool.Parent = character
  1846.         end
  1847.     end
  1848.     wait(0.5)
  1849.     for _, tool in pairs(character:GetChildren()) do
  1850.         if tool:IsA("Tool") then
  1851.             wrap(function()
  1852.                 tool:WaitForChild("Handle")
  1853.                 for i, part in pairs(tool:GetDescendants()) do
  1854.                     if part:IsA("BasePart") then
  1855.                         part:BreakJoints()
  1856.                        
  1857.                         local align = Instance.new("AlignPosition")
  1858.                         local a0, a1 = Instance.new("Attachment"), Instance.new("Attachment")
  1859.                         align.Attachment0, align.Attachment1 = a0, a1
  1860.                         align.RigidityEnabled = true
  1861.                         lock(align, part); lock(a0, part); lock(a1, head);
  1862.                         wrap(function()
  1863.                             local rotX, rotY = 0, math.pi/2
  1864.                             local speed = math.random(25, 100)/1000
  1865.                             local n = tonumber(d) or math.random(300, 700)/100
  1866.                             local y = tonumber(h) or math.random(-100, 100)/100/2
  1867.                             rotY, rotX = rotY + n, rotX + n
  1868.                            
  1869.                             part.CollisionGroupId = math.random(1000000,9999999)
  1870.                             part.Anchored = false
  1871.                             part.CFrame = head.CFrame * CFrame.new(0, 3, 0)
  1872.                            
  1873.                             while part and part.Parent and tool.Parent == character do
  1874.                                 rotX, rotY = rotX + speed, rotY + speed
  1875.                                 a1.Position = Vector3.new(math.sin(rotX) * n, y, math.sin(rotY) * n)
  1876.                                 RunService.RenderStepped:Wait(0)
  1877.                             end
  1878.                         end)
  1879.                     end
  1880.                 end
  1881.             end)
  1882.         end
  1883.     end
  1884. end)
  1885.  
  1886. cmd.add({"blockhats"}, {"blockhats", "Remove the meshes in your hats"}, function()
  1887.     for _, hat in pairs(character:GetChildren()) do
  1888.         if hat:IsA("Accoutrement") and hat:FindFirstChild("Handle") then
  1889.             local handle = hat.Handle
  1890.             if handle:FindFirstChildWhichIsA("SpecialMesh") then
  1891.                 handle:FindFirstChildWhichIsA("SpecialMesh"):Destroy()
  1892.             end
  1893.         end
  1894.     end
  1895. end)
  1896.  
  1897. cmd.add({"blocktools"}, {"blocktools", "Remove the meshes in your tools"}, function()
  1898.     for _, tool in pairs(character:GetChildren()) do
  1899.         if tool:IsA("Tool") then
  1900.             for _, mesh in pairs(tool:GetDescendants()) do
  1901.                 if mesh:IsA("DataModelMesh") then
  1902.                     mesh:Destroy()
  1903.                 end
  1904.             end
  1905.         end
  1906.     end
  1907. end)
  1908.  
  1909. cmd.add({"nomeshes", "nomesh", "blocks"}, {"nomeshes", "Remove all character meshes"}, function()
  1910.     for _, mesh in pairs(character:GetDescendants()) do
  1911.         if mesh:IsA("DataModelMesh") then
  1912.             mesh:Destroy()
  1913.         end
  1914.     end
  1915. end)
  1916.  
  1917. cmd.add({"nodecals", "nodecal", "notextures"}, {"nodecals", "Remove all character images"}, function()
  1918.     for _, img in pairs(character:GetDescendants()) do
  1919.         if img:IsA("Decal") or img:IsA("Texture") then
  1920.             img:Destroy()
  1921.         end
  1922.     end
  1923. end)
  1924.  
  1925. cmd.add({"godmode"}, {"godmode", "Fling anyone that touches you using angular velocity"}, function()
  1926.     lib.disconnect("pfling")
  1927.     local char = player.Character
  1928.     local hum = char:FindFirstChildWhichIsA("Humanoid")
  1929.    
  1930.     if char then
  1931.         local cf = char.HumanoidRootPart.CFrame
  1932.         local bv = Instance.new("BodyAngularVelocity", char.HumanoidRootPart)
  1933.         bv.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
  1934.         bv.P = math.huge
  1935.         bv.AngularVelocity = Vector3.new(0, 9e5, 0)
  1936.         bv.Name = "hum"
  1937.         lock(bv)
  1938.        
  1939.         wait()
  1940.         char.HumanoidRootPart.CFrame = cf
  1941.         char.HumanoidRootPart.Velocity = Vector3.new(0, 0, 0)
  1942.        
  1943.         for i,v in pairs(char:GetDescendants()) do
  1944.             if v:IsA('BasePart') then
  1945.                 v.Massless = true
  1946.                 v.Velocity = Vector3.new(0, 0, 0)
  1947.             end
  1948.         end
  1949.        
  1950.         local c = lib.connect("pfling", game:GetService('RunService').Stepped:Connect(function()
  1951.             for i,v in pairs(char:GetDescendants()) do
  1952.                 if v:IsA('BasePart') then
  1953.                     v.CanCollide = false
  1954.                 end
  1955.             end
  1956.         end))
  1957.         repeat
  1958.             wait()
  1959.         until
  1960.             character ~= char or not c.Connected
  1961.        
  1962.         lib.disconnect("pfling")
  1963.         if lp.Character == char then
  1964.             char:SetPrimaryPartCFrame(cf)
  1965.             bv:Destroy()
  1966.             char.HumanoidRootPart.Velocity = Vector3.new(0,0,0)
  1967.             char.HumanoidRootPart.RotVelocity = Vector3.new(0,0,0)
  1968.         end
  1969.     end
  1970. end)
  1971.  
  1972. cmd.add({"toolfling"}, {"toolfling", "Fling anyone that touches you using an accessory"}, function()
  1973.     lib.disconnect("pfling")
  1974.     local char = player.Character
  1975.     local hrp = char:FindFirstChild("HumanoidRootPart")
  1976.     local hum = char:FindFirstChildWhichIsA("Humanoid")
  1977.     local tors = char:FindFirstChild("Torso") or char:FindFirstChild("UpperTorso")
  1978.     if char then
  1979.         local c = lib.connect("pfling", RunService.Stepped:Connect(function()
  1980.             for i, v in pairs(char:GetDescendants()) do
  1981.                 if v:IsA("BasePart") then
  1982.                     v.CanCollide = false
  1983.                 end
  1984.             end
  1985.         end))
  1986.         tors.Anchored = true
  1987.         local tool = Instance.new("Tool", localPlayer.Backpack)
  1988.         local hat = char:FindFirstChildOfClass("Accessory")
  1989.         local hathandle = hat.Handle
  1990.        
  1991.         hathandle.Parent = tool
  1992.         hathandle.Massless = true
  1993.         tool.GripPos = Vector3.new(0, 9e99, 0)
  1994.         tool.Parent = localPlayer.Character
  1995.        
  1996.         repeat wait() until char:FindFirstChildOfClass("Tool") ~= nil
  1997.         tool.Grip = CFrame.new(Vector3.new(0, 0, 0))
  1998.         tors.Anchored = false
  1999.        
  2000.         repeat
  2001.             hrp.CFrame = hrp.CFrame
  2002.             wait()
  2003.         until not c.Connected
  2004.        
  2005.         hum:UnequipTools()
  2006.         hathandle.Parent = hat
  2007.         hathandle.Massless = false
  2008.         tool:Destroy()
  2009.     end
  2010. end)
  2011.  
  2012. cmd.add({"ungodmode", "untoolfling", "ungod"}, {"ungodmode", "Disable permanent fling"}, function()
  2013.     lib.disconnect("pfling")
  2014. end)
  2015.  
  2016. --[ PLAYER ]--
  2017. cmd.add({"orbit"}, {"orbit <player> <distance>", "Orbit around a player"}, function(p,d)
  2018.     lib.disconnect("orbit")
  2019.     local players = argument.getPlayers(p)
  2020.     local target = players[1]
  2021.     if not target then return end
  2022.    
  2023.     local tchar, char = target.Character, character
  2024.     local thrp = tchar:FindFirstChild("HumanoidRootPart")
  2025.     local hrp = char:FindFirstChild("HumanoidRootPart")
  2026.     local dist = tonumber(d) or 4
  2027.    
  2028.     if tchar and char and thrp and hrp then
  2029.         local sineX, sineZ = 0, math.pi/2
  2030.         lib.connect("orbit", RunService.Stepped:Connect(function()
  2031.             sineX, sineZ = sineX + 0.05, sineZ + 0.05
  2032.             local sinX, sinZ = math.sin(sineX), math.sin(sineZ)
  2033.             if thrp.Parent and hrp.Parent then
  2034.                 hrp.Velocity = Vector3.new(0, 0, 0)
  2035.                 hrp.CFrame = CFrame.new(sinX * dist, 0, sinZ * dist) *
  2036.                     (hrp.CFrame - hrp.CFrame.p) +
  2037.                     thrp.CFrame.p
  2038.             end
  2039.         end))
  2040.     end
  2041. end)
  2042.  
  2043. cmd.add({"uporbit"}, {"uporbit <player> <distance>", "Orbit around a player on the Y axis"}, function(p,d)
  2044.     lib.disconnect("orbit")
  2045.     local players = argument.getPlayers(p)
  2046.     local target = players[1]
  2047.     if not target then return end
  2048.    
  2049.     local tchar, char = target.Character, character
  2050.     local thrp = tchar:FindFirstChild("HumanoidRootPart")
  2051.     local hrp = char:FindFirstChild("HumanoidRootPart")
  2052.     local dist = tonumber(d) or 4
  2053.    
  2054.     if tchar and char and thrp and hrp then
  2055.         local sineX, sineY = 0, math.pi/2
  2056.         lib.connect("orbit", RunService.Stepped:Connect(function()
  2057.             sineX, sineY = sineX + 0.05, sineY + 0.05
  2058.             local sinX, sinY = math.sin(sineX), math.sin(sineY)
  2059.             if thrp.Parent and hrp.Parent then
  2060.                 hrp.Velocity = Vector3.new(0, 0, 0)
  2061.                 hrp.CFrame = CFrame.new(sinX * dist, sinY * dist, 0) *
  2062.                     (hrp.CFrame - hrp.CFrame.p) +
  2063.                     thrp.CFrame.p
  2064.             end
  2065.         end))
  2066.     end
  2067. end)
  2068.  
  2069. cmd.add({"unorbit"}, {"unorbit", "Stop orbiting a player"}, function()
  2070.     lib.disconnect("orbit")
  2071. end)
  2072.  
  2073. cmd.add({"fixcam", "fix"}, {"fixcam", "Fix your camera"}, function()
  2074.     camera.CameraSubject = character:FindFirstChildWhichIsA("Humanoid")
  2075.     camera.CameraType = camtype
  2076. end)
  2077.  
  2078. cmd.add({"fekill", "kill"}, {"fekill <player>", "Kill a player using a tool and FE god"}, function(p)
  2079.     local target = argument.getPlayers(p)[1]
  2080.     if not target then return end
  2081.    
  2082.     local char = character
  2083.     local tchar = target.Character
  2084.     local hrp = character:FindFirstChild("HumanoidRootPart")
  2085.     local hrp2 = tchar:FindFirstChild("HumanoidRootPart")
  2086.     local backpack = localPlayer:FindFirstChildWhichIsA("Backpack")
  2087.     local hum = character:FindFirstChildWhichIsA("Humanoid")
  2088.    
  2089.     if hrp and hrp2 and backpack and hum then
  2090.         hum.Name = "1"
  2091.         local newHum = hum:Clone()
  2092.         newHum.Parent = char
  2093.         newHum.Name = "Humanoid"
  2094.            
  2095.         wait(0.1)
  2096.         hum:Destroy()
  2097.         camera.CameraSubject = char
  2098.         newHum.DisplayDistanceType = "None"
  2099.         wait(0.1)
  2100.        
  2101.         for i, v in pairs(localPlayer.Backpack:GetChildren()) do
  2102.             v.Parent = char
  2103.             hrp.CFrame = hrp2.CFrame * CFrame.new(0, 0, 0) * CFrame.new(math.random(-100, 100)/200,math.random(-100, 100)/200,math.random(-100, 100)/200)
  2104.             RunService.Stepped:Wait(0)
  2105.         end
  2106.        
  2107.         local n = 0
  2108.         repeat
  2109.             RunService.RenderStepped:Wait(0)
  2110.             n = n + 1
  2111.             hrp.CFrame = hrp2.CFrame
  2112.         until (not hrp or not hrp2 or not hrp.Parent or not hrp2.Parent or tchar:FindFirstChild("RightGrip", true) or n > 250) and n > 2
  2113.        
  2114.         hrp.CFrame = CFrame.new(999999, workspace.FallenPartsDestroyHeight + 5,999999)
  2115.         camera.CameraType = Enum.CameraType.Custom
  2116.     end
  2117. end)
  2118.  
  2119. cmd.add({"fling"}, {"fling <player>", "Fling the given player"}, function(p)
  2120.     local players = argument.getPlayers(p)
  2121.     local char = player.Character
  2122.     local hum = char:FindFirstChildWhichIsA("Humanoid")
  2123.     local cf = char.HumanoidRootPart.CFrame
  2124.     for i, plr in pairs(players) do
  2125.         if char and plr and plr.Character then
  2126.             local enemy = plr.Character
  2127.             local bv = Instance.new("BodyAngularVelocity", char.HumanoidRootPart)
  2128.             bv.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
  2129.             bv.P = math.huge
  2130.             bv.AngularVelocity = Vector3.new(9e5, 9e5, 0)
  2131.             bv.Name = "hum"
  2132.            
  2133.             wait()
  2134.             char.HumanoidRootPart.CFrame = cf
  2135.            
  2136.             for i,v in pairs(char:GetDescendants()) do
  2137.                 if v:IsA('BasePart') then
  2138.                     v.Massless = true
  2139.                 end
  2140.             end
  2141.            
  2142.             local c = lib.connect("fling", game:GetService('RunService').Stepped:Connect(function()
  2143.                 for i,v in pairs(char:GetDescendants()) do
  2144.                     if v:IsA('BasePart') then
  2145.                         v.CanCollide = false
  2146.                         v.Velocity = Vector3.new(0, 0, 0)
  2147.                     end
  2148.                 end
  2149.                 if char.PrimaryPart and enemy.PrimaryPart then
  2150.                     char.HumanoidRootPart.CFrame = enemy.HumanoidRootPart.CFrame
  2151.                     char.HumanoidRootPart.Velocity = Vector3.new(0, 0, 0)
  2152.                 end
  2153.             end))
  2154.             repeat
  2155.                 wait()
  2156.             until
  2157.                 character ~= char or not enemy or not enemy.Parent or not c.Connected or not enemy.PrimaryPart or enemy.PrimaryPart.Velocity.magnitude > 100
  2158.            
  2159.             lib.disconnect("fling")
  2160.             if lp.Character == char then
  2161.                 char:SetPrimaryPartCFrame(cf)
  2162.                 bv:Destroy()
  2163.                 char.HumanoidRootPart.Velocity = Vector3.new(0,0,0)
  2164.                 char.HumanoidRootPart.RotVelocity = Vector3.new(0,0,0)
  2165.             end
  2166.             if not c.Connected then
  2167.                 break
  2168.             end
  2169.         end
  2170.     end
  2171. end)
  2172. cmd.add({"unfling"}, {"unfling", "Stop all attempts to fling"}, function()
  2173.     lib.disconnect("fling")
  2174. end)
  2175.  
  2176. cmd.add({"goto", "to", "tp", "teleport"}, {"goto <player/X,Y,Z>", "Teleport to the given player or X,Y,Z coordinates"}, function(p)
  2177.     local players = argument.getPlayers(p)
  2178.     local pos = lib.parseText(p, opt.tupleSeparator)
  2179.     if character then
  2180.         if pos and #pos == 3 then
  2181.             local x,y,z = pos[1], pos[2], pos[3]
  2182.             character:MoveTo(Vector3.new(x, y, z))
  2183.         elseif players[1] and players[1].Character then
  2184.             character:MoveTo((players[1].Character:GetPrimaryPartCFrame() * CFrame.new(1, 0, 2)).p)
  2185.         end
  2186.     end
  2187. end)
  2188.  
  2189. cmd.add({"watch", "view"}, {"watch <player>", "Watch the given player"}, function(p)
  2190.     local players = argument.getPlayers(p)
  2191.     if players[1] and players[1].Character then
  2192.         camera.CameraSubject = players[1].Character:FindFirstChildWhichIsA("Humanoid")
  2193.     end
  2194. end)
  2195. cmd.add({"unwatch", "unview"}, {"unwatch", "Stop watching a player"}, function()
  2196.     if character then
  2197.         camera.CameraSubject = character:FindFirstChildWhichIsA("Humanoid")
  2198.     end
  2199. end)
  2200.  
  2201. cmd.add({"copyaudio", "getaudio"}, {"copyaudio <player>", "Copy all sounds a player is playing to your clipboard  -Cyrus"}, function(p)
  2202.     local players = argument.getPlayers(p)
  2203.     local audios = ""
  2204.     for _, player in pairs(players) do
  2205.         local char = player.Character
  2206.         if char then
  2207.             audios = audios .. ("<<[ %s ]>>"):format(player.Name)
  2208.             for i, v in pairs(char:GetDescendants()) do
  2209.                 if v:IsA("Sound") and v.Playing then
  2210.                     audios = audios .. ("\n[ %s ]: %s"):format(v.Name, v.SoundId)
  2211.                 end
  2212.             end
  2213.         end
  2214.     end
  2215.     setclipboard(audios)
  2216. end)
  2217.  
  2218. cmd.add({"saveaudio", "stealaudio", "steal"}, {"saveaudio <player>", "Save all sounds a player is playing to a file  -Cyrus"}, function(p)
  2219.     local players = argument.getPlayers(p)
  2220.     local audios = ""
  2221.     for _, player in pairs(players) do
  2222.         local char = player.Character
  2223.         if char then
  2224.             audios = audios .. ("<<[ %s ]>>"):format(player.Name)
  2225.             for i, v in pairs(char:GetDescendants()) do
  2226.                 if v:IsA("Sound") and v.Playing then
  2227.                     audios = audios .. ("\n[ %s ]: %s"):format(v.Name, v.SoundId)
  2228.                 end
  2229.             end
  2230.         end
  2231.     end
  2232.     writefile(("Audio-Logs_%c"):format(math.random(1000, 9999)), audios)
  2233. end)
  2234.  
  2235. cmd.add({"follow", "stalk", "walk"}, {"follow <player>", "Follow a player wherever they go"}, function(p)
  2236.     lib.disconnect("follow")
  2237.     local players = argument.getPlayers(p)
  2238.     local targetPlayer = players[1]
  2239.     lib.connect("follow", RunService.Stepped:Connect(function()
  2240.         local target = targetPlayer.Character
  2241.         if target and character then
  2242.             local hum = character:FindFirstChildWhichIsA("Humanoid")
  2243.             if hum then
  2244.                 local targetPart = target:FindFirstChild("Head")
  2245.                 local targetPos = targetPart.Position
  2246.                 hum:MoveTo(targetPos)
  2247.             end
  2248.         end
  2249.     end))
  2250. end)
  2251.  
  2252. cmd.add({"pathfind"}, {"pathfind <player>", "Follow a player using the pathfinder API wherever they go"}, function(p)
  2253.     lib.disconnect("follow")
  2254.     local players = argument.getPlayers(p)
  2255.     local targetPlayer = players[1]
  2256.     local debounce = false
  2257.     lib.connect("follow", RunService.Stepped:Connect(function()
  2258.         if debounce then return end
  2259.         debounce = true
  2260.         local target = targetPlayer.Character
  2261.         if target and character then
  2262.             local hum = character:FindFirstChildWhichIsA("Humanoid")
  2263.             local main = target:FindFirstChild("HumanoidRootPart")
  2264.             if hum then
  2265.                 local targetPart = target:FindFirstChild("HumanoidRootPart") or target:FindFirstChild("Head")
  2266.                 local targetPos = (targetPart.CFrame * CFrame.new(0, 0, -0.5)).p
  2267.                 local PathService = game:GetService("PathfindingService")
  2268.                 local path = PathService:CreatePath({
  2269.                     AgentRadius = 2,
  2270.                     AgentHeight = 5,
  2271.                     AgentCanJump = true
  2272.                 })
  2273.                 local points = path:ComputeAsync(main.Position, targetPos)
  2274.                
  2275.                 if path.Status then
  2276.                     local waypoints = path:GetWaypoints()
  2277.                     for i, waypoint in pairs(waypoints) do
  2278.                         if i > 2 then break end
  2279.                         if waypoint.Action == Enum.PathWaypointAction.Jump then
  2280.                             hum.Jump = true
  2281.                         end
  2282.                         hum:MoveTo(waypoint.Position)
  2283.                         local distance = 5
  2284.                         repeat
  2285.                             wait()
  2286.                             distance = (waypoint.Position - main.Position).magnitude
  2287.                         until
  2288.                             (targetPos - targetPart.Position).magnitude > 2 or distance < 1
  2289.  
  2290.                         if (targetPos - targetPart.Position).magnitude > 2 then
  2291.                             break
  2292.                         end
  2293.                     end
  2294.                 end
  2295.             end
  2296.         end
  2297.         debounce = false
  2298.     end))
  2299. end)
  2300.  
  2301. cmd.add({"unfollow", "unstalk", "unwalk", "unpathfind"}, {"unfollow", "Stop all attempts to follow a player"}, function()
  2302.     lib.disconnect("follow")
  2303. end)
  2304.  
  2305. --[[ FUNCTIONALITY ]]--
  2306. localPlayer.Chatted:Connect(function(str)
  2307.     lib.parseCommand(str)
  2308. end)
  2309.  
  2310.  
  2311. --[[ GUI VARIABLES ]]--
  2312. local ScreenGui
  2313. if not RunService:IsStudio() then
  2314.     ScreenGui = game:GetObjects("rbxassetid://4281507772")[1]
  2315. else
  2316.     repeat wait() until player:FindFirstChild("AdminUI", true)
  2317.     ScreenGui = player:FindFirstChild("AdminUI", true)
  2318. end
  2319.  
  2320. local description = ScreenGui.Description
  2321. local cmdBar = ScreenGui.CmdBar
  2322.     local centerBar = cmdBar.CenterBar
  2323.         local cmdInput = centerBar.Input
  2324.     local cmdAutofill = cmdBar.Autofill
  2325.         local cmdExample = cmdAutofill.Cmd
  2326.     local leftFill = cmdBar.LeftFill
  2327.     local rightFill = cmdBar.RightFill
  2328. local chatLogsFrame = ScreenGui.ChatLogs
  2329.     local chatLogs = chatLogsFrame.Container.Logs
  2330.         local chatExample = chatLogs.TextLabel
  2331. local commandsFrame = ScreenGui.Commands
  2332.     local commandsFilter = commandsFrame.Container.Filter
  2333.     local commandsList = commandsFrame.Container.List
  2334.         local commandExample = commandsList.TextLabel
  2335. local resizeFrame = ScreenGui.Resizeable
  2336. local resizeXY = {
  2337.     Top     = {Vector2.new(0, -1),  Vector2.new(0, -1), "rbxassetid://2911850935"},
  2338.     Bottom  = {Vector2.new(0, 1),   Vector2.new(0, 0),  "rbxassetid://2911850935"},
  2339.     Left    = {Vector2.new(-1, 0),  Vector2.new(1, 0),  "rbxassetid://2911851464"},
  2340.     Right   = {Vector2.new(1, 0),   Vector2.new(0, 0),  "rbxassetid://2911851464"},
  2341.    
  2342.     TopLeft     = {Vector2.new(-1, -1), Vector2.new(1, -1), "rbxassetid://2911852219"},
  2343.     TopRight    = {Vector2.new(1, -1),  Vector2.new(0, -1), "rbxassetid://2911851859"},
  2344.     BottomLeft  = {Vector2.new(-1, 1),  Vector2.new(1, 0),  "rbxassetid://2911851859"},
  2345.     BottomRight = {Vector2.new(1, 1),   Vector2.new(0, 0),  "rbxassetid://2911852219"},
  2346. }
  2347.  
  2348. cmdExample.Parent = nil
  2349. chatExample.Parent = nil
  2350. commandExample.Parent = nil
  2351. resizeFrame.Parent = nil
  2352.  
  2353. local rPlayer = Players:FindFirstChildWhichIsA("Player")
  2354. local coreGuiProtection = {}
  2355.  
  2356. pcall(function()
  2357.     for i, v in pairs(ScreenGui:GetDescendants()) do
  2358.         coreGuiProtection[v] = rPlayer.Name
  2359.     end
  2360.     ScreenGui.DescendantAdded:Connect(function(v)
  2361.         coreGuiProtection[v] = rPlayer.Name
  2362.     end)
  2363.     coreGuiProtection[ScreenGui] = rPlayer.Name
  2364.      
  2365.     local meta = getrawmetatable(game)
  2366.     local tostr = meta.__tostring
  2367.     setreadonly(meta, false)
  2368.     meta.__tostring = newcclosure(function(t)
  2369.         if coreGuiProtection[t] and not checkcaller() then
  2370.             return coreGuiProtection[t]
  2371.         end
  2372.         return tostr(t)
  2373.     end)
  2374. end)
  2375. if not RunService:IsStudio() then
  2376.     local newGui = game:GetService("CoreGui"):FindFirstChildWhichIsA("ScreenGui")
  2377.     newGui.DescendantAdded:Connect(function(v)
  2378.         coreGuiProtection[v] = rPlayer.Name
  2379.     end)
  2380.     for i, v in pairs(ScreenGui:GetChildren()) do
  2381.         v.Parent = newGui
  2382.     end
  2383.     ScreenGui = newGui
  2384. end
  2385.  
  2386. --[[ GUI FUNCTIONS ]]--
  2387. gui = {}
  2388. gui.txtSize = function(ui, x, y)
  2389.     local textService = game:GetService("TextService")
  2390.     return textService:GetTextSize(ui.Text, ui.TextSize, ui.Font, Vector2.new(x, y))
  2391. end
  2392. gui.commands = function()
  2393.     if not commandsFrame.Visible then
  2394.         commandsFrame.Visible = true
  2395.         commandsList.CanvasSize = UDim2.new(0, 0, 0, 0)
  2396.     end
  2397.     for i, v in pairs(commandsList:GetChildren()) do
  2398.         if v:IsA("TextLabel") then
  2399.             Destroy(v)
  2400.         end
  2401.     end
  2402.     local i = 0
  2403.     for cmdName, tbl in pairs(Commands) do
  2404.         local Cmd = commandExample:Clone()
  2405.         Cmd.Parent = commandsList
  2406.         Cmd.Name = cmdName
  2407.         Cmd.Text = " " .. tbl[2][1]
  2408.         Cmd.MouseEnter:Connect(function()
  2409.             description.Visible = true
  2410.             description.Text = tbl[2][2]
  2411.         end)
  2412.         Cmd.MouseLeave:Connect(function()
  2413.             if description.Text == tbl[2][2] then
  2414.                 description.Visible = false
  2415.                 description.Text = ""
  2416.             end
  2417.         end)
  2418.         i = i + 1
  2419.     end
  2420.     commandsList.CanvasSize = UDim2.new(0, 0, 0, i*20+10)
  2421.     commandsFrame.Position = UDim2.new(0.5, -283/2, 0.5, -260/2)
  2422. end
  2423. gui.chatlogs = function()
  2424.     if not chatLogsFrame.Visible then
  2425.         chatLogsFrame.Visible = true
  2426.     end
  2427.     chatLogsFrame.Position = UDim2.new(0.5, -283/2+5, 0.5, -260/2+5)
  2428. end
  2429.  
  2430. gui.tween = function(obj, style, direction, duration, goal)
  2431.     local tweenInfo = TweenInfo.new(duration, Enum.EasingStyle[style], Enum.EasingDirection[direction])
  2432.     local tween = TweenService:Create(obj, tweenInfo, goal)
  2433.     tween:Play()
  2434.     return tween
  2435. end
  2436. gui.mouseIn = function(guiObject, range)
  2437.     local pos1, pos2 = guiObject.AbsolutePosition, guiObject.AbsolutePosition + guiObject.AbsoluteSize
  2438.     local mX, mY = mouse.X, mouse.Y
  2439.     if mX > pos1.X-range and mX < pos2.X+range and mY > pos1.Y-range and mY < pos2.Y+range then
  2440.         return true
  2441.     end
  2442.     return false
  2443. end
  2444. gui.resizeable = function(ui, min, max)
  2445.     local rgui = resizeFrame:Clone()
  2446.     rgui.Parent = ui
  2447.    
  2448.     local mode
  2449.     local UIPos
  2450.     local lastSize
  2451.     local lastPos = Vector2.new()
  2452.    
  2453.     local function update(delta)
  2454.         local xy = resizeXY[(mode and mode.Name) or '']
  2455.         if not mode or not xy then return end
  2456.         local delta = (delta * xy[1]) or Vector2.new()
  2457.         local newSize = Vector2.new(lastSize.X + delta.X, lastSize.Y + delta.Y)
  2458.         newSize = Vector2.new(
  2459.             math.clamp(newSize.X, min.X, max.X),
  2460.             math.clamp(newSize.Y, min.Y, max.Y)
  2461.         )
  2462.         ui.Size = UDim2.new(0, newSize.X, 0, newSize.Y)
  2463.         ui.Position = UDim2.new(
  2464.             UIPos.X.Scale,
  2465.             UIPos.X.Offset + (-(newSize.X - lastSize.X) * xy[2]).X,
  2466.             UIPos.Y.Scale,
  2467.             UIPos.Y.Offset + (delta * xy[2]).Y
  2468.         )
  2469.     end
  2470.    
  2471.     mouse.Move:Connect(function()
  2472.         update(Vector2.new(mouse.X, mouse.Y) - lastPos)
  2473.     end)
  2474.    
  2475.     for _, button in pairs(rgui:GetChildren()) do
  2476.         local isIn = false
  2477.         button.InputBegan:Connect(function(input)
  2478.             if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  2479.                 mode = button
  2480.                 lastPos = Vector2.new(mouse.X, mouse.Y)
  2481.                 lastSize = ui.AbsoluteSize
  2482.                 UIPos = ui.Position
  2483.             end
  2484.         end)
  2485.         button.InputEnded:Connect(function(input)
  2486.             if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  2487.                 mode = nil
  2488.             end
  2489.         end)
  2490.         button.MouseEnter:Connect(function()
  2491.             mouse.Icon = resizeXY[button.Name][3]
  2492.         end)
  2493.         button.MouseLeave:Connect(function()
  2494.             if mouse.Icon == resizeXY[button.Name][3] then
  2495.                 mouse.Icon = ""
  2496.             end
  2497.         end)
  2498.     end
  2499. end
  2500. gui.draggable = function(ui, dragui)
  2501.     if not dragui then dragui = ui end
  2502.     local UserInputService = game:GetService("UserInputService")
  2503.    
  2504.     local dragging
  2505.     local dragInput
  2506.     local dragStart
  2507.     local startPos
  2508.    
  2509.     local function update(input)
  2510.         local delta = input.Position - dragStart
  2511.         ui.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
  2512.     end
  2513.    
  2514.     dragui.InputBegan:Connect(function(input)
  2515.         if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  2516.             dragging = true
  2517.             dragStart = input.Position
  2518.             startPos = ui.Position
  2519.            
  2520.             input.Changed:Connect(function()
  2521.                 if input.UserInputState == Enum.UserInputState.End then
  2522.                     dragging = false
  2523.                 end
  2524.             end)
  2525.         end
  2526.     end)
  2527.    
  2528.     dragui.InputChanged:Connect(function(input)
  2529.         if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
  2530.             dragInput = input
  2531.         end
  2532.     end)
  2533.    
  2534.     UserInputService.InputChanged:Connect(function(input)
  2535.         if input == dragInput and dragging then
  2536.             update(input)
  2537.         end
  2538.     end)
  2539. end
  2540. gui.menuify = function(menu)
  2541.     local exit = menu:FindFirstChild("Exit", true)
  2542.     local mini = menu:FindFirstChild("Minimize", true)
  2543.     local minimized = false
  2544.     local sizeX, sizeY = Instance.new("IntValue", menu), Instance.new("IntValue", menu)
  2545.     mini.MouseButton1Click:Connect(function()
  2546.         minimized = not minimized
  2547.         if minimized then
  2548.             sizeX.Value = menu.Size.X.Offset
  2549.             sizeY.Value = menu.Size.Y.Offset
  2550.             gui.tween(menu, "Quart", "Out", 0.5, {Size = UDim2.new(0, 200, 0, 25)})
  2551.         else
  2552.             gui.tween(menu, "Quart", "Out", 0.5, {Size = UDim2.new(0, sizeX.Value, 0, sizeY.Value)})
  2553.         end
  2554.     end)
  2555.     exit.MouseButton1Click:Connect(function()
  2556.         menu.Visible = false
  2557.     end)
  2558.     gui.draggable(menu, menu.Topbar)
  2559.     menu.Visible = false
  2560. end
  2561. gui.barSelect = function(speed)
  2562.     centerBar.Visible = true
  2563.     gui.tween(centerBar, "Sine", "Out", speed or 0.25, {Size = UDim2.new(0, 250, 1, 15)})
  2564.     gui.tween(leftFill, "Quad", "Out", speed or 0.3, {Position = UDim2.new(0, 0, 0.5, 0)})
  2565.     gui.tween(rightFill, "Quad", "Out", speed or 0.3, {Position = UDim2.new(1, 0, 0.5, 0)})
  2566.     gui.loadCommands()
  2567. end
  2568. gui.barDeselect = function(speed)
  2569.     gui.tween(centerBar, "Sine", "Out", speed or 0.25, {Size = UDim2.new(0, 250, 0, 0)})
  2570.     gui.tween(leftFill, "Sine", "In", speed or 0.3, {Position = UDim2.new(-0.5, 100, 0.5, 0)})
  2571.     gui.tween(rightFill, "Sine", "In", speed or 0.3, {Position = UDim2.new(1.5, -100, 0.5, 0)})
  2572.     for i, v in pairs(cmdAutofill:GetChildren()) do
  2573.         if v:IsA("Frame") then
  2574.             wrap(function()
  2575.                 wait(math.random(1, 200)/2000)
  2576.                 gui.tween(v, "Back", "In", 0.35, {Size = UDim2.new(0, 0, 0, 25)})
  2577.             end)
  2578.         end
  2579.     end
  2580. end
  2581. gui.loadCommands = function()
  2582.     for i, v in pairs(cmdAutofill:GetChildren()) do
  2583.         if v.Name ~= "UIListLayout" then
  2584.             Destroy(v)
  2585.         end
  2586.     end
  2587.     local last = nil
  2588.     local i = 0
  2589.     for name, tbl in pairs(Commands) do
  2590.         local info = tbl[2]
  2591.         local btn = cmdExample:Clone()
  2592.         btn.Parent = cmdAutofill
  2593.         btn.Name = name
  2594.         btn.Input.Text = info[1]
  2595.         i = i + 1
  2596.        
  2597.         local size = btn.Size
  2598.         btn.Size = UDim2.new(0, 0, 0, 25)
  2599.         btn.Size = size
  2600.     end
  2601. end
  2602. gui.searchCommands = function()
  2603.     local _1, _2, _3, _0 = {}, {}, {}, {}
  2604.     local str = cmdInput.Text:gmatch("[^ ;]+")()
  2605.     if str then str = str:lower() else str = "" end
  2606.    
  2607.     for i, v in pairs(cmdAutofill:GetChildren()) do
  2608.         if v:IsA("Frame") then
  2609.             local found = Commands[v.Name]
  2610.             if Commands[v.Name] then
  2611.                 if str ~= "" and v.Name:find(str) == 1 then
  2612.                     v.LayoutOrder = 1
  2613.                     table.insert(_1, v)
  2614.                 end
  2615.                 if str ~= "" and v.Name:find(str) and v.LayoutOrder ~= 1 then
  2616.                     v.LayoutOrder = 2
  2617.                     table.insert(_2, v)
  2618.                 end
  2619.                 if str == "" or v.Name:find(str) == nil then
  2620.                     v.LayoutOrder = 3
  2621.                     table.insert(_3, v)
  2622.                 end
  2623.             end
  2624.             for CmdName, tbl in pairs(Aliases) do
  2625.                 if Commands[v.Name][1] == tbl[1] then
  2626.                     if str ~= "" and CmdName:find(str) == 1 then
  2627.                         v.LayoutOrder = 1
  2628.                         table.insert(_1, v)
  2629.                     end
  2630.                     if str ~= "" and CmdName:find(str) then
  2631.                         v.LayoutOrder = 2
  2632.                         table.insert(_2, v)
  2633.                     end
  2634.                     if str == "" or CmdName:find(str) == nil then
  2635.                         v.LayoutOrder = 3
  2636.                         table.insert(_3, v)
  2637.                     end
  2638.                     break
  2639.                 end
  2640.             end
  2641.         end
  2642.     end
  2643.    
  2644.     for i, v in pairs(_1) do if not lib.find(_0, v) then table.insert(_0, v) end end
  2645.     for i, v in pairs(_2) do if not lib.find(_0, v) then table.insert(_0, v) end end
  2646.     for i, v in pairs(_3) do if not lib.find(_0, v) then table.insert(_0, v) end end
  2647.    
  2648.     local last
  2649.     for i, v in pairs(_0) do
  2650.         local n = (i ^ -0.5) * 125
  2651.         if last then
  2652.             local pos = last.Value.Value
  2653.             local newPos = UDim2.new(0.5, 0, 0, pos + 25 + 3)
  2654.             gui.tween(v, "Quint", "Out", 0.3, {
  2655.                 Size = UDim2.new(0.5, n, 0, 25)
  2656.             })
  2657.             v.Value.Value = newPos.Y.Offset
  2658.             v.LayoutOrder = i
  2659.         else
  2660.             gui.tween(v, "Quint", "Out", 0.3, {
  2661.                 Size = UDim2.new(0.5, n, 0, 25)
  2662.             })
  2663.             v.Value.Value = 0
  2664.             v.LayoutOrder = i
  2665.         end
  2666.         last = v
  2667.     end
  2668. end
  2669.  
  2670. --[[ GUI FUNCTIONALITY ]]--
  2671. mouse.KeyDown:Connect(function(k)
  2672.     if k:lower() == opt.prefix then
  2673.         gui.barSelect()
  2674.         cmdInput.Text = ''
  2675.         cmdInput:CaptureFocus()
  2676.     end
  2677. end)
  2678.  
  2679. cmdInput.FocusLost:Connect(function(enterPressed)
  2680.     if enterPressed then
  2681.         wrap(function()
  2682.             lib.parseCommand(opt.prefix .. cmdInput.Text)
  2683.         end)
  2684.     end
  2685.     gui.barDeselect()
  2686. end)
  2687.  
  2688. cmdInput.Changed:Connect(function(p)
  2689.     if p ~= "Text" then return end
  2690.     gui.searchCommands()
  2691. end)
  2692.  
  2693. gui.barDeselect(0)
  2694. cmdBar.Visible = true
  2695. gui.menuify(chatLogsFrame)
  2696. gui.menuify(commandsFrame)
  2697. gui.resizeable(chatLogsFrame, Vector2.new(173,58), Vector2.new(1000,1000))
  2698. gui.resizeable(commandsFrame, Vector2.new(184,84), Vector2.new(1000,1000))
  2699.  
  2700. commandsFilter.Changed:Connect(function(p)
  2701.     if p ~= "Text" then return end
  2702.     for i, v in pairs(commandsList:GetChildren()) do
  2703.         if v:IsA("TextLabel") then
  2704.             if v.Name:find(commandsFilter.Text:lower()) and v.Name:find(commandsFilter.Text:lower()) <= 2 then
  2705.                 v.Visible = true
  2706.             else
  2707.                 v.Visible = false
  2708.             end
  2709.         end
  2710.     end
  2711. end)
  2712.  
  2713. local function bindToChat(plr, msg)
  2714.     local chatMsg = chatExample:Clone()
  2715.     for i, v in pairs(chatLogs:GetChildren()) do
  2716.         if v:IsA("TextLabel") then
  2717.             v.LayoutOrder = v.LayoutOrder + 1
  2718.         end
  2719.     end
  2720.     chatMsg.Parent = chatLogs
  2721.     chatMsg.Text = ("[%s]: %s"):format(plr.Name, msg)
  2722.    
  2723.     local txtSize = gui.txtSize(chatMsg, chatMsg.AbsoluteSize.X, 100)
  2724.     chatMsg.Size = UDim2.new(1, -5, 0, txtSize.Y)
  2725. end
  2726.  
  2727. for i, plr in pairs(Players:GetPlayers()) do
  2728.     plr.Chatted:Connect(function(msg)
  2729.         bindToChat(plr, msg)
  2730.     end)
  2731. end
  2732. Players.PlayerAdded:Connect(function(plr)
  2733.     plr.Chatted:Connect(function(msg)
  2734.         bindToChat(plr, msg)
  2735.     end)
  2736. end)
  2737.  
  2738. mouse.Move:Connect(function()
  2739.     description.Position = UDim2.new(0, mouse.X, 0, mouse.Y)
  2740.     local size = gui.txtSize(description, 200, 100)
  2741.     description.Size = UDim2.new(0, size.X, 0, size.Y)
  2742. end)
  2743.  
  2744. RunService.Stepped:Connect(function()
  2745.     chatLogs.CanvasSize = UDim2.new(0, 0, 0, chatLogs.UIListLayout.AbsoluteContentSize.Y)
  2746.     commandsList.CanvasSize = UDim2.new(0, 0, 0, commandsList.UIListLayout.AbsoluteContentSize.Y)
  2747. end)
  2748.  
  2749. function Destroy(guiObject)
  2750.     if not pcall(function()guiObject.Parent = game:GetService("CoreGui")end) then
  2751.         guiObject.Parent = nil
  2752.     end
  2753. end
Add Comment
Please, Sign In to add comment