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