Rylenss

v4-MAIN

Jan 4th, 2026 (edited)
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 58.67 KB | None | 0 0
  1.  
  2. --by Rylvns
  3. --last edited 1/5/26
  4.  
  5. --!native
  6. --!optimize 2
  7.  
  8. type LIBRARY = {
  9.     BOTS: {number},
  10.     OPERATORS: {number},
  11.  
  12.     CONFIG: {
  13.         OPTIMIZE: number,
  14.         COMMAND_SEPERATOR: string,
  15.         STACKING_SEPERATOR: string,
  16.     },
  17.  
  18.     COMMANDS: {[string]: {any}},
  19.     TYPES: {
  20.         player: ()->{Player},
  21.         bot: ()->{Player},
  22.         string: (string|number)->boolean,
  23.         int: (number|string)->boolean,
  24.         boolean: (string)->boolean,
  25.     },
  26.  
  27.     LYRICS: {[string]: {any}},
  28.  
  29.     AFTER_LOADED_RUN: string,
  30. };
  31.  
  32. type BOT = {
  33.     ID: number,
  34.     ORDER: number,
  35. };
  36.  
  37. local LIBRARY: LIBRARY = shared.LIBRARY;
  38. local BOT: BOT = shared.BOT;
  39.  
  40. BOT.State = {
  41.     _enabled = true,
  42.     _activeCommands = {},
  43.     _lastMessage = "",
  44.     _defaultGravity = workspace.Gravity,
  45. };
  46.  
  47. local EncodingService = game:GetService("EncodingService");
  48. local HttpService = game:GetService("HttpService");
  49. local UserService = game:GetService("UserService");
  50. local RunService = game:GetService("RunService");
  51. local Players = game:GetService("Players");
  52. local Player = Players.LocalPlayer;
  53. local Camera = workspace.CurrentCamera;
  54.  
  55. local TextChatService = game:GetService("TextChatService");
  56. local ReplicatedStorage = game:GetService("ReplicatedStorage");
  57.  
  58. Player.Idled:Connect(function()
  59.     game:GetService("VirtualUser"):CaptureController();
  60.     game:GetService("VirtualUser"):ClickButton2(Vector2.new());
  61. end);
  62.  
  63. local function Or(A, ...)
  64.     for _, Value in {...} do
  65.         if Value ~= A then continue end;
  66.         return true;
  67.     end;
  68.     return false;
  69. end;
  70.  
  71. local function TableFind(Table, Clue, Search)
  72.     for Index, Value in Table do
  73.         if Search == "v" and Value == Clue then
  74.             return Index;
  75.         elseif Search == "i" and Index == Clue then
  76.             return Value;
  77.         end;
  78.     end;
  79.     return nil;
  80. end;
  81.  
  82. function RemoveExtraSpaces(String)
  83.     while string.find(String, "  ") do
  84.         String = string.gsub(String, "  ", " ");
  85.     end;
  86.     return String;
  87. end;
  88.  
  89. function Say(String)
  90.     if Or(RemoveExtraSpaces(String), "", " ") then return end;
  91.     if ReplicatedStorage:FindFirstChild("DefaultChatSystemChatEvents") then
  92.         ReplicatedStorage.DefaultChatSystemChatEvents.SayMessageRequest:FireServer(String, "All");
  93.     else
  94.         TextChatService.TextChannels.RBXGeneral:SendAsync(String);
  95.     end;
  96. end;
  97. --"hello:there" ignores quotes
  98. local function GetArguments(String, ArgumentsSchema)
  99.     local Arguments = {};
  100.     local Tokens = {};
  101.     local InQuotes = false;
  102.     local QuoteCharacter = nil;
  103.     local CurrentToken = "";
  104.     for Index = 1, #String do
  105.         local Character = string.sub(String, Index, Index);
  106.         if Or(Character, `"`, `'`) and not InQuotes then
  107.             InQuotes = true;
  108.             QuoteCharacter = Character;
  109.         elseif Character == QuoteCharacter and InQuotes then
  110.             InQuotes = false;
  111.             Tokens[#Tokens+1] = CurrentToken;
  112.             CurrentToken = "";
  113.             QuoteCharacter = nil;
  114.         elseif Character == LIBRARY.CONFIG.COMMAND_SEPERATOR and not InQuotes then
  115.             if #CurrentToken > 0 then
  116.                 Tokens[#Tokens+1] = CurrentToken;
  117.                 CurrentToken = "";
  118.             end;
  119.         else
  120.             CurrentToken ..= Character;
  121.         end;
  122.     end;
  123.     if #CurrentToken > 0 then
  124.         Tokens[#Tokens+1] = CurrentToken;
  125.     end;
  126.     local NamedArgs = {};
  127.     local OrderedArgs = {};
  128.     for _, Token in ipairs(Tokens) do
  129.         local ColonPos = string.find(Token, ":");
  130.         if ColonPos then
  131.             local ArgName = string.sub(Token, 1, ColonPos-1);
  132.             local ArgValue = string.sub(Token, ColonPos+1);
  133.             NamedArgs[ArgName] = ArgValue;
  134.         else
  135.             OrderedArgs[#OrderedArgs+1] = Token;
  136.         end;
  137.     end;
  138.     local Results = {};
  139.     local UsedPositions = {};
  140.  
  141.     for Index, Schema in ipairs(ArgumentsSchema) do
  142.         if NamedArgs[Schema.name] then
  143.             Results[Index] = NamedArgs[Schema.name];
  144.             UsedPositions[Index] = true;
  145.         end;
  146.     end;
  147.  
  148.     local OrderedIndex = 1;
  149.     for Index, Schema in ipairs(ArgumentsSchema) do
  150.         if not UsedPositions[Index] and OrderedArgs[OrderedIndex] then
  151.             Results[Index] = OrderedArgs[OrderedIndex];
  152.             OrderedIndex+= 1;
  153.         end;
  154.     end;
  155.  
  156.     return table.unpack(Results, 1, #ArgumentsSchema);
  157. end;
  158.  
  159. local function SplitCommand(String)
  160.     local FirstSep = string.find(String, LIBRARY.CONFIG.COMMAND_SEPERATOR);
  161.     if FirstSep then
  162.         local Command = string.sub(String, 1, FirstSep-1);
  163.         local Arguments = string.sub(String, FirstSep+#LIBRARY.CONFIG.COMMAND_SEPERATOR);
  164.         return Command, Arguments;
  165.     else
  166.         return String;
  167.     end;
  168. end;
  169.  
  170. function GetOrderedBots()
  171.     local Bots = {};
  172.     for _, BotUserId in LIBRARY.BOTS do
  173.         local Bot = Players:GetPlayerByUserId(BotUserId);
  174.         if Bot then
  175.             table.insert(Bots, Bot);
  176.         end;
  177.     end;
  178.     return Bots;
  179. end;
  180. function CheckType(Type, Value, Executor)
  181.     local TypeHandler = LIBRARY.TYPES[Type];
  182.     if not TypeHandler then return end;
  183.  
  184.     if Or(Type, "player", "bot") then
  185.         local LowerString = string.lower(Value);
  186.         if LowerString == "all" then
  187.             return Player;
  188.         elseif LowerString == "me" then--disallow for bot type?
  189.             return Executor;
  190.         elseif LowerString == "random" then
  191.             local List = TypeHandler();
  192.             return List[math.random(1, #List)];
  193.         elseif LowerString == "closest" then
  194.             if not Executor or not Executor.Character then return end;
  195.             return GetClosestPlayer(TypeHandler(), Executor.Character:GetPivot().Position);
  196.         end;
  197.  
  198.         local Matches = {};
  199.         for _, _Player in TypeHandler() do
  200.             if not string.find(string.lower(_Player.Name), LowerString) and not string.find(string.lower(_Player.DisplayName), LowerString) then continue end;
  201.             table.insert(Matches, _Player);
  202.         end;
  203.         if #Matches == 1 then
  204.             return Matches[1];
  205.         end;
  206.     elseif Type == "int" then
  207.         if TypeHandler(Value) then
  208.             return tonumber(Value);
  209.         end;
  210.     elseif Type == "boolean" then
  211.         return TypeHandler(Value);
  212.     end;
  213. end;
  214. function GetClosestPlayer(_Players, Origin)
  215.     local Lowest = math.huge;
  216.     local Closest = nil;
  217.  
  218.     for _, _Player in _Players do
  219.         if _Player == Player then continue end;
  220.         if not _Player.Character then continue end;
  221.         local RootPart = _Player.Character.PrimaryPart;
  222.         if not RootPart then continue end;
  223.         local Distance = (Origin-RootPart.Position).Magnitude;
  224.         if Distance < Lowest then
  225.             Lowest, Closest = Distance, _Player;
  226.         end;
  227.     end;
  228.  
  229.     return Closest;
  230. end;
  231. function GetRandomPlayer()
  232.     local _Players = LIBRARY.TYPES.player();
  233.     return _Players[Random.new():NextInteger(1, #_Players)];
  234. end;
  235. function IsCharacterGood(_Player)
  236.     return _Player.Character and _Player.Character.PrimaryPart ~= nil;
  237. end;
  238. local function RandomPointOnSphere(Center, Radius)
  239.     local Theta = math.random()*math.pi*2;
  240.     local Phi = math.acos(2*math.random()-1);
  241.     local X = Radius*math.sin(Phi)*math.cos(Theta);
  242.     local Y = Radius*math.sin(Phi)*math.sin(Theta);
  243.     local Z = Radius*math.cos(Phi);
  244.     return Center+Vector3.new(X, Y, Z);
  245. end;
  246.  
  247.  
  248. local function CleanCommandData(CommandData)
  249.     if CommandData.tasks then
  250.         for _, Task in CommandData.tasks do
  251.             task.cancel(Task);
  252.         end;
  253.     end;
  254.     if CommandData.task then
  255.         task.cancel(CommandData.task);
  256.     end;
  257.     if CommandData.coroutines then
  258.         for _, Coroutine in CommandData.coroutines do
  259.             coroutine.close(Coroutine :: thread);
  260.         end;
  261.     end;
  262.     if CommandData.coroutine then
  263.         coroutine.close(CommandData.coroutine);
  264.     end;
  265.     if CommandData.coroutineYield then
  266.         coroutine.resume(CommandData.coroutineYield);
  267.     end;
  268.     if CommandData.signal then
  269.         CommandData.signal:Disconnect();
  270.     end;
  271.     if CommandData.object then
  272.         CommandData.object:Destroy();
  273.     end;
  274. end;
  275.  
  276. function ProcessCommand(Executor, Message)
  277.     if not BOT.State._enabled then return end;
  278.  
  279.     if string.find(Message, "=", #Message-3) then
  280.         local DecodedBuffer = EncodingService:Base64Decode(buffer.fromstring(Message));
  281.         Message = buffer.tostring(DecodedBuffer);
  282.     end;
  283.  
  284.     Message = Message:lower();
  285.  
  286.     local Command, Arguments = SplitCommand(Message);
  287.  
  288.     local CommandSchema = LIBRARY.COMMANDS[Command];
  289.     if not CommandSchema then
  290.         BOT.State._lastMessage = Message;
  291.         if BOT.State._activeCommands.mock then
  292.             if BOT.State._activeCommands.mock.user ~= Executor then return end;
  293.             Say(Message);
  294.         end;
  295.         return;
  296.     end;
  297.  
  298.     if Command == "chat" then
  299.         local String, A = GetArguments(Arguments, CommandSchema);
  300.         local ArgSchema = CommandSchema[1].expects[String];
  301.         if not ArgSchema then
  302.             Say(String);
  303.             return;
  304.         end;
  305.  
  306.         if String == "fps" then
  307.             Say(`{math.ceil(1/game.Stats.FrameTime)} fps`);
  308.         elseif String == "ping" then
  309.         elseif String == "id" then
  310.             Say(`Hyperion-{BOT.ID}`);
  311.         elseif String == "bots" then
  312.             if not ArgSchema.expects[A] then return end;
  313.             if A == "online" then
  314.                 Say(table.concat(LIBRARY.TYPES.bot(), ", "));
  315.             elseif A == "offline" then
  316.                 Say("idk man");
  317.             end;
  318.         elseif String == "last" then
  319.             Say(BOT.State._lastMessage);
  320.         end;
  321.     end;
  322.  
  323.     if Command == "spam" then
  324.         if BOT.State._activeCommands[Command] then return end;
  325.  
  326.         local String, Count = GetArguments(Arguments, CommandSchema);
  327.         Count = CheckType("int", Count) or 5;
  328.  
  329.         BOT.State._activeCommands[Command] = {};
  330.         local CommandData = BOT.State._activeCommands[Command];
  331.         CommandData.coroutine = coroutine.create(function()
  332.             for _ = 1, Count do
  333.                 Say(String);
  334.                 task.wait(1/4);
  335.             end;
  336.             BOT.State._activeCommands[Command] = nil;
  337.         end);
  338.         coroutine.resume(CommandData.coroutine);
  339.     end;
  340.  
  341.     if Command == "mock" then
  342.         local User = GetArguments(Arguments, CommandSchema);
  343.         User = CheckType("player", User, Executor);
  344.         if not User then return end;
  345.         BOT.State._activeCommands.mock = {user = User};
  346.     end;
  347.  
  348.     if Command == "stop" then
  349.         local _Command = GetArguments(Arguments, CommandSchema);
  350.  
  351.         if _Command == "all" then
  352.             for _, CommandData in BOT.State._activeCommands do
  353.                 CleanCommandData(CommandData);
  354.             end;
  355.             table.clear(BOT.State._activeCommands);
  356.         else
  357.             local CommandData = BOT.State._activeCommands[_Command];
  358.             if not CommandData then return end;
  359.             CleanCommandData(CommandData);
  360.             BOT.State._activeCommands[_Command] = nil;
  361.         end;
  362.  
  363.         workspace.Gravity = BOT.State._defaultGravity;
  364.         Camera.CameraSubject = Player.Character.Humanoid;
  365.     end;
  366.  
  367.     if Command == "sing" then
  368.         if BOT.State._activeCommands[Command] then return end
  369.  
  370.         local Song = GetArguments(Arguments, CommandSchema)
  371.         local SongLyrics = LIBRARY.MUSIC_LYRICS[Song]
  372.         if not SongLyrics then return end
  373.  
  374.         BOT.State._activeCommands[Command] = {coroutines = {}}
  375.         local CommandData = BOT.State._activeCommands[Command]
  376.  
  377.         for Index, Lyric in SongLyrics do
  378.             local ShouldSay = Lyric.all or ((Index-1)%#LIBRARY.TYPES.bot()+1 == BOT.ORDER);
  379.             if not ShouldSay then continue end;
  380.  
  381.             CommandData.coroutines[Index] = coroutine.create(function()
  382.                 task.wait(Lyric.time);
  383.                 Say(Lyric.lyric);
  384.             end);
  385.             coroutine.resume(CommandData.coroutines[Index]);
  386.         end;
  387.     end;
  388.  
  389.     if Command == "freeze" then
  390.         if BOT.State._activeCommands[Command] then return end;
  391.  
  392.         local Bot = GetArguments(Arguments, CommandSchema);
  393.         Bot = CheckType("bot", Bot, Executor);
  394.         if Bot ~= Player then return end;
  395.         if not IsCharacterGood(Player) then return end;
  396.  
  397.         BOT.State._activeCommands[Command] = {};
  398.         local CommandData = BOT.State._activeCommands[Command];
  399.         CommandData.coroutineYield = coroutine.create(function()
  400.             Player.Character.HumanoidRootPart.Anchored = true;
  401.             coroutine.yield();
  402.             if not IsCharacterGood(Player) then return end;
  403.             Player.Character.HumanoidRootPart.Anchored = false;
  404.         end);
  405.         coroutine.resume(CommandData.coroutineYield);
  406.     end;
  407.  
  408.     if Command == "tp" then
  409.         local Bot, User = GetArguments(Arguments, CommandSchema);
  410.  
  411.         Bot = CheckType("bot", Bot, Executor);
  412.         if Bot ~= Player then return end;
  413.         if not IsCharacterGood(Player) then return end;
  414.  
  415.         User = CheckType("player", User, Executor);
  416.         if not User then return end;
  417.         if not IsCharacterGood(User) then return end;
  418.  
  419.         Player.Character.PrimaryPart.CFrame = User.Character:GetPivot();
  420.     end;
  421.  
  422.     if Command == "raid" then
  423.         if BOT.State._activeCommands[Command] then return end;
  424.         if not IsCharacterGood(Player) then return end;
  425.  
  426.         local Interval = GetArguments(Arguments, CommandSchema);
  427.         Interval = CheckType("int", Interval) or 1;
  428.  
  429.         local Random = Random.new();
  430.  
  431.         BOT.State._activeCommands[Command] = {
  432.             target = nil,
  433.             clock = 0,
  434.         };
  435.         local CommandData = BOT.State._activeCommands[Command];
  436.         CommandData.signal = RunService.RenderStepped:Connect(function()
  437.             local CurrentClock = os.clock();
  438.             if CurrentClock-CommandData.clock >= Interval then
  439.                 local _Players = LIBRARY.TYPES.player();
  440.                 CommandData.target = _Players[Random:NextInteger(1, #_Players)];
  441.                 if not IsCharacterGood(CommandData.target) then return end;
  442.                 CommandData.clock = CurrentClock;
  443.             end;
  444.             if not IsCharacterGood(Player) then return end;
  445.             Player.Character.HumanoidRootPart.CFrame = CommandData.target.Character:GetPivot();
  446.         end);
  447.     end;
  448.  
  449.     if Command == "line" then
  450.         local User, Rows, SpacingX, SpacingZ = GetArguments(Arguments, CommandSchema);
  451.  
  452.         User = CheckType("player", User, Executor);
  453.         if not User or not IsCharacterGood(User) then return end;
  454.  
  455.         local NumBots = #LIBRARY.TYPES.bot();
  456.  
  457.         Rows = CheckType("int", Rows) or 5;
  458.         Rows = NumBots < Rows and NumBots or Rows;
  459.         SpacingX = CheckType("int", SpacingX) or 4;
  460.         SpacingZ = CheckType("int", SpacingZ) or 2;
  461.  
  462.         local LastCFrame = User.Character.PrimaryPart.CFrame*CFrame.new(-(SpacingX*(Rows/2))-(SpacingX/2), 0, SpacingZ);
  463.         local Row = math.floor((BOT.ORDER-1)/Rows);
  464.         local Col = (BOT.ORDER-1)%Rows;
  465.         Player.Character.PrimaryPart.CFrame = LastCFrame*CFrame.new(Col*SpacingX+SpacingX, 0, Row*SpacingZ);
  466.     end;
  467.  
  468.     if Command == "align" then
  469.         local Shape, Size = GetArguments(Arguments, CommandSchema);
  470.         Size = CheckType("int", Size) or 10;
  471.     end;
  472.  
  473.     if Command == "orbit" then
  474.         if BOT.State._activeCommands[Command] then return end;
  475.  
  476.         local User, Radius, Speed, Sit, Facing, Mode = GetArguments(Arguments, CommandSchema);
  477.  
  478.         User = CheckType("player", User, Executor);
  479.         if not User or not IsCharacterGood(User) then return end;
  480.  
  481.         Radius = CheckType("int", Radius) or 20;
  482.         Speed = (CheckType("int", Speed) or 5)/10;
  483.         Sit = not not CheckType("boolean", Sit);
  484.         Facing = CommandSchema[5].expects[Facing] and Facing or "in";
  485.  
  486.         local Modes = {
  487.             ["circle"] = function(a, t, i, n)
  488.                 local theta = a+(i/n)*math.pi*2;
  489.                 return CFrame.new(
  490.                     math.cos(theta)*Radius,
  491.                     0,
  492.                     math.sin(theta)*Radius
  493.                 );
  494.             end,
  495.             ["wave"] = function(a, t, i, n)
  496.                 local theta = a+(i/n)*math.pi*2;
  497.                 return CFrame.new(
  498.                     math.cos(theta)*Radius,
  499.                     math.sin(theta*2)*(Radius/3),
  500.                     math.sin(theta)*Radius
  501.                 );
  502.             end,
  503.             ["figure8"] = function(a, t, i, n)
  504.                 local theta = a+(i/n)*math.pi*2;
  505.                 return CFrame.new(
  506.                     math.sin(theta)*Radius,
  507.                     0,
  508.                     math.sin(theta*2)*Radius/2
  509.                 );
  510.             end,
  511.             ["pulse"] = function(a, t, i, n)
  512.                 local theta = a+(i/n)*math.pi*2;
  513.                 local r = Radius*(1+math.sin(t*3)*0.4);
  514.                 return CFrame.new(
  515.                     math.cos(theta)*r,
  516.                     0,
  517.                     math.sin(theta)*r
  518.                 );
  519.             end,
  520.             ["bounce"] = function(a, t, i, n)
  521.                 local theta = a+(i/n)*math.pi*2;
  522.                 return CFrame.new(
  523.                     math.cos(theta)*Radius,
  524.                     math.abs(math.sin(t*2))*Radius*0.8,
  525.                     math.sin(theta)*Radius
  526.                 );
  527.             end,
  528.             ["zigzag"] = function(a, t, i, n)
  529.                 local theta = a+(i/n)*math.pi*2;
  530.                 local x = math.floor(theta/(math.pi/4))%2 == 0 and Radius/2 or-Radius/2;
  531.                 return CFrame.new(
  532.                     x,
  533.                     0,
  534.                     math.sin(theta)*Radius
  535.                 );
  536.             end,
  537.             ["rect"] = function(a, t, i, n)
  538.                 local theta = a+(i/n)*math.pi*2
  539.                 local step = math.pi*2/4
  540.                 local r = (math.floor(theta/step)%2 == 0) and Radius or Radius*0.4
  541.                 return CFrame.new(
  542.                     math.cos(theta)*r,
  543.                     0,
  544.                     math.sin(theta)*r
  545.                 )
  546.             end,
  547.             ["spiral"] = function(a, t, i, n)
  548.                 local theta = a+(i/n)*math.pi*2;
  549.                 local r = Radius*(i/n);
  550.                 return CFrame.new(
  551.                     math.cos(theta)*r,
  552.                     0,
  553.                     math.sin(theta)*r
  554.                 );
  555.             end,
  556.             ["star"] = function(a, t, i, n)
  557.                 local theta = a+(i/n)*math.pi*2;
  558.                 local k = 5;
  559.                 local r = Radius*(0.5+0.5*math.cos(k*theta));
  560.                 return CFrame.new(math.cos(theta)*r, 0, math.sin(theta)*r);
  561.             end,
  562.             ["heart"] = function(a, t, i, n)
  563.                 local theta = a+(i/n)*math.pi*2;
  564.                 local s = Radius/18;
  565.  
  566.                 local x = s*16*math.sin(theta)^3;
  567.                 local z = s*(13*math.cos(theta)-5*math.cos(2*theta)-2*math.cos(3*theta)-math.cos(4*theta));
  568.  
  569.                 return CFrame.new(x, 0,-z);
  570.             end,
  571.             ["inf"] = function(a, t, i, n)
  572.                 local theta = a+(i/n)*math.pi*2;
  573.                 return CFrame.new(
  574.                     Radius*math.cos(theta),
  575.                     0,
  576.                     Radius*math.sin(theta)*math.cos(theta)
  577.                 );
  578.             end,
  579.             ["rose"] = function(a, t, i, n)
  580.                 local theta = a+(i/n)*math.pi*2;
  581.                 local k = 4;
  582.                 local r = Radius*math.cos(k*theta);
  583.                 return CFrame.new(
  584.                     math.cos(theta)*r,
  585.                     0,
  586.                     math.sin(theta)*r
  587.                 );
  588.             end,
  589.             ["polygon"] = function(a, t, i, n)
  590.                 local sides = math.max(3, math.floor(n))
  591.                 local theta = a + (i / sides) * math.pi * 2
  592.                 local step = math.pi * 2 / sides
  593.                 local ang = math.floor(theta / step) * step
  594.                 return CFrame.new(
  595.                     math.cos(ang) * Radius,
  596.                     0,
  597.                     math.sin(ang) * Radius
  598.                 )
  599.             end,
  600.             ["helix"] = function(a, t, i, n)
  601.                 local theta = a + (i / n) * math.pi * 2
  602.                 return CFrame.new(
  603.                     math.cos(theta) * Radius,
  604.                     ((i / n) - 0.5) * Radius,
  605.                     math.sin(theta) * Radius
  606.                 )
  607.             end,
  608.             ["epicycloid"] = function(a, t, i, n)
  609.                 local theta = a + (i / n) * math.pi * 2
  610.                 local k = 3
  611.                 return CFrame.new(
  612.                     Radius * (math.cos(theta) + math.cos(k * theta)),
  613.                     0,
  614.                     Radius * (math.sin(theta) + math.sin(k * theta))
  615.                 )
  616.             end,
  617.             ["hypocycloid"] = function(a, t, i, n)
  618.                 local theta = a + (i / n) * math.pi * 2
  619.                 local k = 4
  620.                 return CFrame.new(
  621.                     Radius * ((k - 1) * math.cos(theta) + math.cos((k - 1) * theta)),
  622.                     0,
  623.                     Radius * ((k - 1) * math.sin(theta) - math.sin((k - 1) * theta))
  624.                 )
  625.             end,
  626.             ["logspiral"] = function(a, t, i, n)
  627.                 local theta = a + (i / n) * math.pi * 2
  628.                 local r = Radius * math.exp(0.15 * theta)
  629.                 return CFrame.new(
  630.                     math.cos(theta) * r,
  631.                     0,
  632.                     math.sin(theta) * r
  633.                 )
  634.             end,
  635.             --["target"] = function(a, t, i, n)
  636.             --  local rings = 3
  637.             --  local ring = (i % rings) / rings
  638.             --  local theta = a + ring * math.pi * 2
  639.             --  return CFrame.new(
  640.             --      math.cos(theta) * Radius * (0.4 + ring),
  641.             --      0,
  642.             --      math.sin(theta) * Radius * (0.4 + ring)
  643.             --  )
  644.             --end,
  645.             ["gear"] = function(a, t, i, n)
  646.                 local teeth = 8
  647.                 local theta = a + (i / n) * math.pi * 2
  648.                 local r = Radius * (1 + 0.2 * math.sin(teeth * theta))
  649.                 return CFrame.new(
  650.                     math.cos(theta) * r,
  651.                     0,
  652.                     math.sin(theta) * r
  653.                 )
  654.             end,
  655.  
  656.         };
  657.  
  658.         Mode = Modes[Mode] and Mode or "circle";
  659.  
  660.         BOT.State._activeCommands[Command] = { clock = os.clock() };
  661.         local CommandData = BOT.State._activeCommands[Command];
  662.  
  663.         CommandData.object = Instance.new("Part");
  664.         CommandData.object.Anchored = true;
  665.         CommandData.object.CanCollide = false;
  666.         CommandData.object.Transparency = 1;
  667.         CommandData.object.AudioCanCollide = false;
  668.         CommandData.object.CanTouch = false;
  669.         CommandData.object.Parent = workspace;
  670.  
  671.         CommandData.signal = RunService.RenderStepped:Connect(function()
  672.             if not IsCharacterGood(Player) then return end;
  673.             if not IsCharacterGood(User) then return end;
  674.  
  675.             local botCount = #LIBRARY.TYPES.bot();
  676.             local botIndex = BOT.ORDER;
  677.  
  678.             local TimePassed = os.clock()-CommandData.clock;
  679.             local CurrentAngle = TimePassed*Speed;
  680.  
  681.             local Offset = Modes[Mode](CurrentAngle, TimePassed, botIndex, botCount);
  682.  
  683.             CommandData.object.CFrame = CFrame.new(User.Character.PrimaryPart.Position);
  684.  
  685.             local worldCFrame = CommandData.object.CFrame*Offset;
  686.             local lookTarget = User.Character.PrimaryPart.Position;
  687.             local flatLookTarget = Vector3.new(lookTarget.X, worldCFrame.Position.Y, lookTarget.Z);
  688.             Player.Character.PrimaryPart.CFrame = CFrame.lookAt(worldCFrame.Position, flatLookTarget)*CFrame.Angles(0, Facing == "out" and math.pi or 0, 0);
  689.  
  690.             workspace.Gravity = 0;
  691.             Player.Character.Humanoid.Sit = Sit;
  692.             Camera.CameraSubject = CommandData.object;
  693.         end);
  694.     end;
  695.  
  696.     if Command == "spin" then
  697.         if BOT.State._activeCommands[Command] then return end;
  698.         if not IsCharacterGood(Player) then return end;
  699.  
  700.         local Speed = GetArguments(Arguments, CommandSchema);
  701.         Speed = CheckType("int", Speed) or 90;
  702.  
  703.         BOT.State._activeCommands[Command] = {};
  704.         local CommandData = BOT.State._activeCommands[Command];
  705.  
  706.         CommandData.object = Instance.new("BodyThrust", Player.Character.PrimaryPart);
  707.         CommandData.object.Force = Vector3.new(Speed, 0, 0);
  708.         CommandData.object.Location = Player.Character.PrimaryPart.Position;
  709.  
  710.         CommandData.signal = RunService.RenderStepped:Connect(function()
  711.             if not IsCharacterGood(Player) then return end;
  712.  
  713.             Player.Character.Head.CanCollide = false;
  714.             Player.Character.PrimaryPart.CanCollide = false;
  715.             if Player.Character.Humanoid.RigType == Enum.HumanoidRigType.R15 then
  716.                 Player.Character.UpperTorso.CanCollide = false;
  717.                 Player.Character.LowerTorso.CanCollide = false;
  718.             else
  719.                 Player.Character["Left Leg"].CanCollide = false;
  720.                 Player.Character["Right Leg"].CanCollide = false;
  721.             end;
  722.         end);
  723.     end;
  724.  
  725.     if Command == "stack" then
  726.         if BOT.State._activeCommands[Command] then return end;
  727.  
  728.         local User, Sit, OffsetY, OffsetZ = GetArguments(Arguments, CommandSchema);
  729.  
  730.         User = CheckType("player", User, Executor);
  731.         if not User then return end;
  732.  
  733.         Sit = not not CheckType("boolean", Sit);
  734.         OffsetY = CheckType("int", OffsetY) or 1.1;
  735.         OffsetZ = CheckType("int", OffsetZ) or 1;
  736.  
  737.         BOT.State._activeCommands[Command] = {};
  738.         local CommandData = BOT.State._activeCommands[Command];
  739.         CommandData.signal = RunService.RenderStepped:Connect(function()
  740.             if not IsCharacterGood(Player) then return end;
  741.             if not IsCharacterGood(User) then return end;
  742.  
  743.             Player.Character.PrimaryPart.CFrame = (BOT.ORDER == 1 and User.Character.PrimaryPart.CFrame or GetOrderedBots()[BOT.ORDER-1].Character.PrimaryPart.CFrame)*CFrame.new(0, OffsetY, OffsetZ);
  744.  
  745.             Player.Character.Humanoid.Sit = Sit;
  746.             workspace.Gravity = 0;
  747.         end);
  748.     end;
  749.  
  750.     if Command == "fling" then
  751.  
  752.     end;
  753.  
  754.     if Command == "antifling" then
  755.  
  756.     end;
  757.  
  758.     if Command == "stare" then
  759.         local _User = GetArguments(Arguments, CommandSchema);
  760.         local User = CheckType("player", _User, Executor);
  761.         if not User then return end;
  762.  
  763.         BOT.State._activeCommands[Command] = {};
  764.         local CommandData = BOT.State._activeCommands[Command];
  765.         CommandData.signal = RunService.RenderStepped:Connect(function()
  766.             if not IsCharacterGood(Player) then return end;
  767.             if not IsCharacterGood(User) then return end;
  768.  
  769.             local Target = _User == "closest" and GetClosestPlayer(LIBRARY.TYPES.player(), Player.Character:GetPivot().Position) or User;
  770.             local TargetPosition = Target.Character:GetPivot().Position;
  771.  
  772.             local PrimaryPart = Player.Character.PrimaryPart;
  773.             local Origin = PrimaryPart.Position;
  774.  
  775.             PrimaryPart.CFrame = CFrame.new(Origin, Vector3.new(TargetPosition.X, Origin.Y, TargetPosition.Z));
  776.         end);
  777.     end;
  778.  
  779.     if Command == "annoy" then
  780.         if BOT.State._activeCommands[Command] then return end;
  781.  
  782.         local User, Radius = GetArguments(Arguments, CommandSchema);
  783.  
  784.         User = CheckType("player", User, Executor);
  785.         if not User then return end;
  786.  
  787.         Radius = CheckType("int", Radius) or 10;
  788.  
  789.         BOT.State._activeCommands[Command] = {
  790.             clock = 0,
  791.             position = Vector3.zero,
  792.         };
  793.         local CommandData = BOT.State._activeCommands[Command];
  794.  
  795.         CommandData.signal = RunService.RenderStepped:Connect(function()
  796.             if not IsCharacterGood(Player) then return end;
  797.             if not IsCharacterGood(User) then return end;
  798.  
  799.             local TargetPos = User.Character.PrimaryPart.Position;
  800.  
  801.             if os.clock()-CommandData.clock >= 1/10 then
  802.                 CommandData.position = RandomPointOnSphere(TargetPos, Radius);
  803.                 CommandData.clock = os.clock();
  804.             end;
  805.  
  806.             Player.Character.PrimaryPart.CFrame = CFrame.new(CommandData.position, TargetPos);
  807.  
  808.             Player.Character.Head.CanCollide = false;
  809.             Player.Character.PrimaryPart.CanCollide = false;
  810.             if Player.Character.Humanoid.RigType == Enum.HumanoidRigType.R15 then
  811.                 Player.Character.UpperTorso.CanCollide = false;
  812.                 Player.Character.LowerTorso.CanCollide = false;
  813.             else
  814.                 Player.Character["Left Leg"].CanCollide = false;
  815.                 Player.Character["Right Leg"].CanCollide = false;
  816.             end;
  817.  
  818.             workspace.Gravity = 0;
  819.         end);
  820.     end;
  821.  
  822.     if Command == "rocket" then
  823.         if not IsCharacterGood(Player) then return end;
  824.  
  825.         local User = GetArguments(Arguments, CommandSchema);
  826.         User = CheckType("player", User, Executor);
  827.         if User and not IsCharacterGood(User) then return end;
  828.  
  829.         local PrimaryPart = Player.Character.PrimaryPart;
  830.  
  831.         BOT.State._activeCommands[Command] = {};
  832.         local CommandData = BOT.State._activeCommands[Command];
  833.  
  834.         CommandData.object = Instance.new("BodyThrust", PrimaryPart);
  835.         CommandData.object.Force = Vector3.new(2000, 300, 0);
  836.         CommandData.object.Location = PrimaryPart.Position;
  837.  
  838.         CommandData.signal = RunService.RenderStepped:Connect(function()
  839.             if not IsCharacterGood(Player) then return end;
  840.  
  841.             Player.Character.Head.CanCollide = false;
  842.             PrimaryPart.CanCollide = false;
  843.             if Player.Character.Humanoid.RigType == Enum.HumanoidRigType.R15 then
  844.                 Player.Character.UpperTorso.CanCollide = false;
  845.                 Player.Character.LowerTorso.CanCollide = false;
  846.             else
  847.                 Player.Character["Left Leg"].CanCollide = false;
  848.                 Player.Character["Right Leg"].CanCollide = false;
  849.             end;
  850.         end);
  851.  
  852.         CommandData.task = task.delay(1, function()
  853.             Player.Character.Humanoid.Health = 0;
  854.             task.wait(0.2);
  855.             CommandData.signal:Disconnect();
  856.             CommandData.object:Destroy();
  857.         end);
  858.     end;
  859.  
  860.     if Command == "roam" then
  861.  
  862.     end;
  863.  
  864.     if Command == "path" then
  865.  
  866.     end;
  867.  
  868.     if Command == "follow" then
  869.  
  870.     end;
  871.  
  872.     if Command == "server" then
  873.  
  874.     end;
  875.  
  876.     if Command == "emote" then
  877.  
  878.     end;
  879.  
  880.     if Command == "jump" then
  881.         local Bot = GetArguments(Arguments, CommandSchema);
  882.         Bot = CheckType("bot", Bot, Executor);
  883.         if Bot ~= Player then return end;
  884.         if not IsCharacterGood(Player) then return end;
  885.         Player.Character.Humanoid.Jump = true;
  886.     end;
  887.  
  888.     if Command == "sit" then
  889.         local Bot = GetArguments(Arguments, CommandSchema);
  890.         Bot = CheckType("bot", Bot, Executor);
  891.         if Bot ~= Player then return end;
  892.         if not IsCharacterGood(Player) then return end;
  893.         Player.Character.Humanoid.Sit = true;
  894.     end;
  895.  
  896.     if Command == "render" then
  897.         local Toggle = GetArguments(Arguments, CommandSchema);
  898.         Toggle = not not CheckType("boolean", Toggle);
  899.         RunService:Set3dRenderingEnabled(Toggle);
  900.     end;
  901.  
  902.     if Command == "fpscap" then
  903.         local Cap = GetArguments(Arguments, CommandSchema);
  904.         Cap = CheckType("int", Cap) or 60;
  905.         if setfpscap and typeof(setfpscap) == "function" then
  906.             setfpscap(Cap);
  907.         end;
  908.     end;
  909.  
  910.     if Command == "reset" then
  911.         local Bot = GetArguments(Arguments, CommandSchema);
  912.         Bot = CheckType("bot", Bot, Executor);
  913.         if Bot ~= Player then return end;
  914.         if not IsCharacterGood(Player) then return end;
  915.         Player.Character.Humanoid.Health = 0;
  916.     end;
  917.  
  918.     if Command == "connect" then
  919.         local User = GetArguments(Arguments, CommandSchema);
  920.         User = CheckType("player", User, Executor);
  921.         if User and not IsCharacterGood(User) then return end;
  922.  
  923.         ConnectPlayer(User);
  924.  
  925.         Say(`connected {User.DisplayName}.`);
  926.     end;
  927.  
  928.     if Command == "reload" then
  929.         local Bot = GetArguments(Arguments, CommandSchema);
  930.         Bot = CheckType("bot", Bot, Executor);
  931.         if Bot ~= Player then return end;
  932.  
  933.         BOT.State._enabled = false;
  934.         for _, CommandData in BOT.State._activeCommands do
  935.             CleanCommandData(CommandData);
  936.         end;
  937.         table.clear(BOT.State._activeCommands);
  938.  
  939.         Say("reloading...");
  940.  
  941.         for Index = 1, 5 do
  942.             local Success = pcall(function()
  943.                 loadstring(game:HttpGet("https://pastebin.com/raw/U93Pe1nz"))();
  944.             end);
  945.             if Success then
  946.                 Say("success.");
  947.                 break;
  948.             else
  949.                 Say(`failed to load. retrying... ({Index}/5)`);
  950.             end;
  951.             task.wait(2);
  952.         end;
  953.     end;
  954.  
  955.     if Command == "disable" then
  956.         local Bot = GetArguments(Arguments, CommandSchema);
  957.         Bot = CheckType("bot", Bot, Executor);
  958.         if Bot ~= Player then return end;
  959.  
  960.         BOT.State._enabled = false;
  961.         for _, CommandData in BOT.State._activeCommands do
  962.             CleanCommandData(CommandData);
  963.         end;
  964.         table.clear(BOT.State._activeCommands);
  965.  
  966.         Say("disabled.");
  967.     end;
  968.  
  969.     if Command == "rejoin" then
  970.         local Bot = GetArguments(Arguments, CommandSchema);
  971.         Bot = CheckType("bot", Bot, Executor);
  972.         if Bot ~= Player then return end;
  973.         game:GetService("TeleportService"):TeleportToPlaceInstance(game.PlaceId, game.JobId, Player);
  974.     end;
  975.  
  976.     if Command == "leave" then
  977.         local Bot = GetArguments(Arguments, CommandSchema);
  978.         Bot = CheckType("bot", Bot, Executor);
  979.         if Bot ~= Player then return end;
  980.         game:Shutdown();
  981.     end;
  982.    
  983.     -- ai
  984.  
  985.     if Command == "swarm" then
  986.         if BOT.State._activeCommands[Command] then return end;
  987.  
  988.         local User, Speed, Radius = GetArguments(Arguments, CommandSchema);
  989.  
  990.         User = CheckType("player", User, Executor);
  991.         if not User or not IsCharacterGood(User) then return end;
  992.  
  993.         Speed = CheckType("int", Speed) or 5;
  994.         Radius = CheckType("int", Radius) or 15;
  995.  
  996.         BOT.State._activeCommands[Command] = {
  997.             clock = 0,
  998.             position = Vector3.zero,
  999.             randomOffset = Random.new():NextNumber(-1, 1) * math.pi * 2,
  1000.         };
  1001.         local CommandData = BOT.State._activeCommands[Command];
  1002.  
  1003.         CommandData.signal = RunService.RenderStepped:Connect(function()
  1004.             if not IsCharacterGood(Player) then return end;
  1005.             if not IsCharacterGood(User) then return end;
  1006.  
  1007.             local TimePassed = os.clock() - CommandData.clock;
  1008.             local TargetPos = User.Character.PrimaryPart.Position;
  1009.  
  1010.             -- Erratic movement pattern
  1011.             local angle = TimePassed * Speed + CommandData.randomOffset;
  1012.             local bobbing = math.sin(angle * 3) * 5;
  1013.             local circling = angle + math.sin(angle * 2) * 0.5;
  1014.  
  1015.             local offset = Vector3.new(
  1016.                 math.cos(circling) * Radius,
  1017.                 bobbing,
  1018.                 math.sin(circling) * Radius
  1019.             );
  1020.  
  1021.             CommandData.position = TargetPos + offset;
  1022.             Player.Character.PrimaryPart.CFrame = CFrame.new(CommandData.position, TargetPos);
  1023.  
  1024.             workspace.Gravity = 0;
  1025.         end);
  1026.     end;
  1027.  
  1028.     if Command == "wall" then
  1029.         if BOT.State._activeCommands[Command] then return end;
  1030.  
  1031.         local User, Distance, Height = GetArguments(Arguments, CommandSchema);
  1032.  
  1033.         User = CheckType("player", User, Executor);
  1034.         if not User or not IsCharacterGood(User) then return end;
  1035.  
  1036.         Distance = CheckType("int", Distance) or 10;
  1037.         Height = CheckType("int", Height) or 3;
  1038.  
  1039.         BOT.State._activeCommands[Command] = {};
  1040.         local CommandData = BOT.State._activeCommands[Command];
  1041.  
  1042.         CommandData.signal = RunService.RenderStepped:Connect(function()
  1043.             if not IsCharacterGood(Player) then return end;
  1044.             if not IsCharacterGood(User) then return end;
  1045.  
  1046.             local botCount = #LIBRARY.TYPES.bot();
  1047.             local UserCFrame = User.Character.PrimaryPart.CFrame;
  1048.  
  1049.             local row = math.floor((BOT.ORDER - 1) / Height);
  1050.             local col = (BOT.ORDER - 1) % Height;
  1051.  
  1052.             local wallOffset = CFrame.new(
  1053.                 (col - Height / 2) * 4,
  1054.                 row * 4,
  1055.                 -Distance
  1056.             );
  1057.  
  1058.             Player.Character.PrimaryPart.CFrame = UserCFrame * wallOffset;
  1059.             workspace.Gravity = 0;
  1060.         end);
  1061.     end;
  1062.  
  1063.     if Command == "surround" then
  1064.         if BOT.State._activeCommands[Command] then return end;
  1065.  
  1066.         local User, Layers = GetArguments(Arguments, CommandSchema);
  1067.  
  1068.         User = CheckType("player", User, Executor);
  1069.         if not User or not IsCharacterGood(User) then return end;
  1070.  
  1071.         Layers = CheckType("int", Layers) or 3;
  1072.  
  1073.         BOT.State._activeCommands[Command] = {};
  1074.         local CommandData = BOT.State._activeCommands[Command];
  1075.  
  1076.         CommandData.signal = RunService.RenderStepped:Connect(function()
  1077.             if not IsCharacterGood(Player) then return end;
  1078.             if not IsCharacterGood(User) then return end;
  1079.  
  1080.             local botCount = #LIBRARY.TYPES.bot();
  1081.             local botsPerLayer = math.ceil(botCount / Layers);
  1082.             local layer = math.floor((BOT.ORDER - 1) / botsPerLayer);
  1083.             local posInLayer = (BOT.ORDER - 1) % botsPerLayer;
  1084.  
  1085.             local radius = 5 + (layer * 5);
  1086.             local angle = (posInLayer / botsPerLayer) * math.pi * 2;
  1087.  
  1088.             local offset = Vector3.new(
  1089.                 math.cos(angle) * radius,
  1090.                 0,
  1091.                 math.sin(angle) * radius
  1092.             );
  1093.  
  1094.             local TargetPos = User.Character.PrimaryPart.Position;
  1095.             Player.Character.PrimaryPart.CFrame = CFrame.new(TargetPos + offset, TargetPos);
  1096.         end);
  1097.     end;
  1098.  
  1099.     if Command == "escort" then
  1100.         if BOT.State._activeCommands[Command] then return end;
  1101.  
  1102.         local User, Side = GetArguments(Arguments, CommandSchema);
  1103.  
  1104.         User = CheckType("player", User, Executor);
  1105.         if not User or not IsCharacterGood(User) then return end;
  1106.  
  1107.         Side = CommandSchema[2] and CommandSchema[2].expects[Side] and Side or "right";
  1108.  
  1109.         BOT.State._activeCommands[Command] = {};
  1110.         local CommandData = BOT.State._activeCommands[Command];
  1111.  
  1112.         CommandData.signal = RunService.RenderStepped:Connect(function()
  1113.             if not IsCharacterGood(Player) then return end;
  1114.             if not IsCharacterGood(User) then return end;
  1115.  
  1116.             local UserCFrame = User.Character.PrimaryPart.CFrame;
  1117.             local botCount = #LIBRARY.TYPES.bot();
  1118.             local row = math.floor((BOT.ORDER - 1) / 2);
  1119.             local side = (BOT.ORDER - 1) % 2 == 0 and -1 or 1;
  1120.  
  1121.             if Side == "front" then
  1122.                 Player.Character.PrimaryPart.CFrame = UserCFrame * CFrame.new(side * 4, 0, -4 - (row * 4));
  1123.             elseif Side == "back" then
  1124.                 Player.Character.PrimaryPart.CFrame = UserCFrame * CFrame.new(side * 4, 0, 4 + (row * 4));
  1125.             else -- left/right
  1126.                 local xOffset = Side == "left" and -4 - (row * 4) or 4 + (row * 4);
  1127.                 Player.Character.PrimaryPart.CFrame = UserCFrame * CFrame.new(xOffset, 0, side * 4);
  1128.             end;
  1129.         end);
  1130.     end;
  1131.  
  1132.     if Command == "tornado" then
  1133.         if BOT.State._activeCommands[Command] then return end;
  1134.  
  1135.         local User, Speed, Height = GetArguments(Arguments, CommandSchema);
  1136.  
  1137.         User = CheckType("player", User, Executor);
  1138.         if not User or not IsCharacterGood(User) then return end;
  1139.  
  1140.         Speed = CheckType("int", Speed) or 5;
  1141.         Height = CheckType("int", Height) or 20;
  1142.  
  1143.         BOT.State._activeCommands[Command] = {
  1144.             clock = os.clock(),
  1145.         };
  1146.         local CommandData = BOT.State._activeCommands[Command];
  1147.  
  1148.         CommandData.object = Instance.new("BodyThrust", Player.Character.PrimaryPart);
  1149.         CommandData.object.Force = Vector3.new(Speed * 100, 0, 0);
  1150.         CommandData.object.Location = Player.Character.PrimaryPart.Position;
  1151.  
  1152.         CommandData.signal = RunService.RenderStepped:Connect(function()
  1153.             if not IsCharacterGood(Player) then return end;
  1154.             if not IsCharacterGood(User) then return end;
  1155.  
  1156.             local TimePassed = os.clock() - CommandData.clock;
  1157.             local TargetPos = User.Character.PrimaryPart.Position;
  1158.             local botCount = #LIBRARY.TYPES.bot();
  1159.  
  1160.             local angle = TimePassed * Speed + ((BOT.ORDER / botCount) * math.pi * 2);
  1161.             local radius = 10 - (BOT.ORDER / botCount) * 8;
  1162.             local heightOffset = (BOT.ORDER / botCount) * Height;
  1163.  
  1164.             local offset = Vector3.new(
  1165.                 math.cos(angle) * radius,
  1166.                 heightOffset + math.sin(TimePassed * 2) * 3,
  1167.                 math.sin(angle) * radius
  1168.             );
  1169.  
  1170.             Player.Character.PrimaryPart.CFrame = CFrame.new(TargetPos + offset);
  1171.  
  1172.             Player.Character.Head.CanCollide = false;
  1173.             Player.Character.PrimaryPart.CanCollide = false;
  1174.             workspace.Gravity = 0;
  1175.         end);
  1176.     end;
  1177.  
  1178.     if Command == "pyramid" then
  1179.         if BOT.State._activeCommands[Command] then return end;
  1180.  
  1181.         local User, Spacing = GetArguments(Arguments, CommandSchema);
  1182.  
  1183.         User = CheckType("player", User, Executor);
  1184.         if not User or not IsCharacterGood(User) then return end;
  1185.  
  1186.         Spacing = CheckType("int", Spacing) or 4;
  1187.  
  1188.         BOT.State._activeCommands[Command] = {};
  1189.         local CommandData = BOT.State._activeCommands[Command];
  1190.  
  1191.         CommandData.signal = RunService.RenderStepped:Connect(function()
  1192.             if not IsCharacterGood(Player) then return end;
  1193.             if not IsCharacterGood(User) then return end;
  1194.  
  1195.             local botCount = #LIBRARY.TYPES.bot();
  1196.             local level = 0;
  1197.             local posInLevel = BOT.ORDER - 1;
  1198.             local botsInLevel = 1;
  1199.  
  1200.             -- Calculate which level of pyramid
  1201.             local totalBots = 0;
  1202.             while totalBots + botsInLevel <= BOT.ORDER - 1 do
  1203.                 totalBots = totalBots + botsInLevel;
  1204.                 level = level + 1;
  1205.                 botsInLevel = botsInLevel + 1;
  1206.             end;
  1207.             posInLevel = (BOT.ORDER - 1) - totalBots;
  1208.  
  1209.             local UserCFrame = User.Character.PrimaryPart.CFrame;
  1210.             local xOffset = (posInLevel - botsInLevel / 2) * Spacing;
  1211.  
  1212.             Player.Character.PrimaryPart.CFrame = UserCFrame * CFrame.new(xOffset, level * Spacing, Spacing * 2);
  1213.             workspace.Gravity = 0;
  1214.         end);
  1215.     end;
  1216.    
  1217.     if Command == "helix" then
  1218.         if BOT.State._activeCommands[Command] then return end;
  1219.  
  1220.         local User, Speed, Radius, Height = GetArguments(Arguments, CommandSchema);
  1221.  
  1222.         User = CheckType("player", User, Executor);
  1223.         if not User or not IsCharacterGood(User) then return end;
  1224.  
  1225.         Speed = CheckType("int", Speed) or 3;
  1226.         Radius = CheckType("int", Radius) or 8;
  1227.         Height = CheckType("int", Height) or 30;
  1228.  
  1229.         BOT.State._activeCommands[Command] = {
  1230.             clock = os.clock(),
  1231.         };
  1232.         local CommandData = BOT.State._activeCommands[Command];
  1233.  
  1234.         CommandData.signal = RunService.RenderStepped:Connect(function()
  1235.             if not IsCharacterGood(Player) then return end;
  1236.             if not IsCharacterGood(User) then return end;
  1237.  
  1238.             local TimePassed = os.clock() - CommandData.clock;
  1239.             local TargetPos = User.Character.PrimaryPart.Position;
  1240.             local botCount = #LIBRARY.TYPES.bot();
  1241.  
  1242.             -- Create DNA helix pattern
  1243.             local strand = (BOT.ORDER - 1) % 2; -- Which strand (0 or 1)
  1244.             local progress = ((BOT.ORDER - 1) / botCount) + (TimePassed * Speed / 10);
  1245.  
  1246.             local angle = progress * math.pi * 4 + (strand * math.pi);
  1247.             local heightOffset = (progress % 1) * Height - (Height / 2);
  1248.  
  1249.             local offset = Vector3.new(
  1250.                 math.cos(angle) * Radius,
  1251.                 heightOffset,
  1252.                 math.sin(angle) * Radius
  1253.             );
  1254.  
  1255.             Player.Character.PrimaryPart.CFrame = CFrame.new(TargetPos + offset, TargetPos);
  1256.             workspace.Gravity = 0;
  1257.         end);
  1258.     end;
  1259.  
  1260.     if Command == "weave" then
  1261.         if BOT.State._activeCommands[Command] then return end;
  1262.  
  1263.         local User, Speed = GetArguments(Arguments, CommandSchema);
  1264.  
  1265.         User = CheckType("player", User, Executor);
  1266.         if not User or not IsCharacterGood(User) then return end;
  1267.  
  1268.         Speed = CheckType("int", Speed) or 3;
  1269.  
  1270.         BOT.State._activeCommands[Command] = {
  1271.             clock = os.clock(),
  1272.         };
  1273.         local CommandData = BOT.State._activeCommands[Command];
  1274.  
  1275.         CommandData.signal = RunService.RenderStepped:Connect(function()
  1276.             if not IsCharacterGood(Player) then return end;
  1277.             if not IsCharacterGood(User) then return end;
  1278.  
  1279.             local TimePassed = os.clock() - CommandData.clock;
  1280.             local TargetPos = User.Character.PrimaryPart.Position;
  1281.             local botCount = #LIBRARY.TYPES.bot();
  1282.  
  1283.             local phase = (BOT.ORDER / botCount) * math.pi * 2;
  1284.             local t = TimePassed * Speed + phase;
  1285.  
  1286.             -- Figure-8 weaving pattern
  1287.             local offset = Vector3.new(
  1288.                 math.sin(t) * 12,
  1289.                 math.sin(t * 2) * 5,
  1290.                 math.cos(t) * 12
  1291.             );
  1292.  
  1293.             Player.Character.PrimaryPart.CFrame = CFrame.new(TargetPos + offset);
  1294.             workspace.Gravity = 0;
  1295.         end);
  1296.     end;
  1297.  
  1298.     if Command == "matrix" then
  1299.         if BOT.State._activeCommands[Command] then return end;
  1300.  
  1301.         local User, Spacing = GetArguments(Arguments, CommandSchema);
  1302.  
  1303.         User = CheckType("player", User, Executor);
  1304.         if not User or not IsCharacterGood(User) then return end;
  1305.  
  1306.         Spacing = CheckType("int", Spacing) or 5;
  1307.  
  1308.         BOT.State._activeCommands[Command] = {};
  1309.         local CommandData = BOT.State._activeCommands[Command];
  1310.  
  1311.         CommandData.signal = RunService.RenderStepped:Connect(function()
  1312.             if not IsCharacterGood(Player) then return end;
  1313.             if not IsCharacterGood(User) then return end;
  1314.  
  1315.             local TargetPos = User.Character.PrimaryPart.Position;
  1316.             local botCount = #LIBRARY.TYPES.bot();
  1317.             local sideLength = math.ceil(botCount ^ (1/3));
  1318.  
  1319.             local i = BOT.ORDER - 1;
  1320.             local x = i % sideLength;
  1321.             local y = math.floor((i / sideLength)) % sideLength;
  1322.             local z = math.floor(i / (sideLength * sideLength));
  1323.  
  1324.             local offset = Vector3.new(
  1325.                 (x - sideLength / 2) * Spacing,
  1326.                 (y - sideLength / 2) * Spacing,
  1327.                 (z - sideLength / 2) * Spacing
  1328.             );
  1329.  
  1330.             Player.Character.PrimaryPart.CFrame = CFrame.new(TargetPos + offset, TargetPos);
  1331.             workspace.Gravity = 0;
  1332.         end);
  1333.     end;
  1334.  
  1335.     if Command == "pendulum" then
  1336.         if BOT.State._activeCommands[Command] then return end;
  1337.  
  1338.         local User, Speed, Distance = GetArguments(Arguments, CommandSchema);
  1339.  
  1340.         User = CheckType("player", User, Executor);
  1341.         if not User or not IsCharacterGood(User) then return end;
  1342.  
  1343.         Speed = CheckType("int", Speed) or 2;
  1344.         Distance = CheckType("int", Distance) or 15;
  1345.  
  1346.         BOT.State._activeCommands[Command] = {
  1347.             clock = os.clock(),
  1348.         };
  1349.         local CommandData = BOT.State._activeCommands[Command];
  1350.  
  1351.         CommandData.signal = RunService.RenderStepped:Connect(function()
  1352.             if not IsCharacterGood(Player) then return end;
  1353.             if not IsCharacterGood(User) then return end;
  1354.  
  1355.             local TimePassed = os.clock() - CommandData.clock;
  1356.             local TargetPos = User.Character.PrimaryPart.Position;
  1357.             local botCount = #LIBRARY.TYPES.bot();
  1358.  
  1359.             local phase = (BOT.ORDER / botCount) * math.pi * 2;
  1360.             local swing = math.sin(TimePassed * Speed + phase) * Distance;
  1361.  
  1362.             local offset = Vector3.new(swing, (BOT.ORDER - 1) * 3, 0);
  1363.  
  1364.             Player.Character.PrimaryPart.CFrame = CFrame.new(TargetPos + offset, TargetPos);
  1365.             workspace.Gravity = 0;
  1366.         end);
  1367.     end;
  1368.  
  1369.     if Command == "tunnel" then
  1370.         if BOT.State._activeCommands[Command] then return end;
  1371.  
  1372.         local User, Length, Width = GetArguments(Arguments, CommandSchema);
  1373.  
  1374.         User = CheckType("player", User, Executor);
  1375.         if not User or not IsCharacterGood(User) then return end;
  1376.  
  1377.         Length = CheckType("int", Length) or 30;
  1378.         Width = CheckType("int", Width) or 8;
  1379.  
  1380.         BOT.State._activeCommands[Command] = {};
  1381.         local CommandData = BOT.State._activeCommands[Command];
  1382.  
  1383.         CommandData.signal = RunService.RenderStepped:Connect(function()
  1384.             if not IsCharacterGood(Player) then return end;
  1385.             if not IsCharacterGood(User) then return end;
  1386.  
  1387.             local UserCFrame = User.Character.PrimaryPart.CFrame;
  1388.             local botCount = #LIBRARY.TYPES.bot();
  1389.             local botsPerRing = 8;
  1390.             local ringIndex = math.floor((BOT.ORDER - 1) / botsPerRing);
  1391.             local posInRing = (BOT.ORDER - 1) % botsPerRing;
  1392.  
  1393.             local angle = (posInRing / botsPerRing) * math.pi * 2;
  1394.             local zOffset = (ringIndex / math.ceil(botCount / botsPerRing)) * Length;
  1395.  
  1396.             local offset = CFrame.new(
  1397.                 math.cos(angle) * Width,
  1398.                 math.sin(angle) * Width,
  1399.                 zOffset
  1400.             );
  1401.  
  1402.             Player.Character.PrimaryPart.CFrame = UserCFrame * offset;
  1403.             workspace.Gravity = 0;
  1404.         end);
  1405.     end;
  1406.  
  1407.     if Command == "protect" then
  1408.         if BOT.State._activeCommands[Command] then return end;
  1409.  
  1410.         local User, Enemy, Distance = GetArguments(Arguments, CommandSchema);
  1411.  
  1412.         User = CheckType("player", User, Executor);
  1413.         if not User or not IsCharacterGood(User) then return end;
  1414.  
  1415.         Enemy = CheckType("player", Enemy, Executor);
  1416.         Distance = CheckType("int", Distance) or 5;
  1417.  
  1418.         BOT.State._activeCommands[Command] = {};
  1419.         local CommandData = BOT.State._activeCommands[Command];
  1420.  
  1421.         CommandData.signal = RunService.RenderStepped:Connect(function()
  1422.             if not IsCharacterGood(Player) then return end;
  1423.             if not IsCharacterGood(User) then return end;
  1424.  
  1425.             local UserPos = User.Character.PrimaryPart.Position;
  1426.             local EnemyPos;
  1427.  
  1428.             if Enemy and IsCharacterGood(Enemy) then
  1429.                 EnemyPos = Enemy.Character.PrimaryPart.Position;
  1430.             else
  1431.                 -- Find closest non-user player
  1432.                 Enemy = GetClosestPlayer(LIBRARY.TYPES.player(), UserPos);
  1433.                 if not Enemy or not IsCharacterGood(Enemy) then return end;
  1434.                 EnemyPos = Enemy.Character.PrimaryPart.Position;
  1435.             end;
  1436.  
  1437.             local direction = (UserPos - EnemyPos).Unit;
  1438.             local blockPos = UserPos + (direction * -Distance);
  1439.  
  1440.             Player.Character.PrimaryPart.CFrame = CFrame.new(blockPos, EnemyPos);
  1441.         end);
  1442.     end;
  1443.  
  1444.     if Command == "dodge" then
  1445.         if BOT.State._activeCommands[Command] then return end;
  1446.  
  1447.         local User, MinDistance = GetArguments(Arguments, CommandSchema);
  1448.  
  1449.         User = CheckType("player", User, Executor);
  1450.         if not User or not IsCharacterGood(User) then return end;
  1451.  
  1452.         MinDistance = CheckType("int", MinDistance) or 10;
  1453.  
  1454.         BOT.State._activeCommands[Command] = {
  1455.             dodgePos = nil,
  1456.             clock = 0,
  1457.         };
  1458.         local CommandData = BOT.State._activeCommands[Command];
  1459.  
  1460.         CommandData.signal = RunService.RenderStepped:Connect(function()
  1461.             if not IsCharacterGood(Player) then return end;
  1462.             if not IsCharacterGood(User) then return end;
  1463.  
  1464.             local currentPos = Player.Character.PrimaryPart.Position;
  1465.             local TargetPos = User.Character.PrimaryPart.Position;
  1466.             local distance = (TargetPos - currentPos).Magnitude;
  1467.  
  1468.             if distance < MinDistance or not CommandData.dodgePos then
  1469.                 local angle = math.random() * math.pi * 2;
  1470.                 local dodgeDistance = MinDistance + math.random() * 5;
  1471.                 CommandData.dodgePos = TargetPos + Vector3.new(
  1472.                     math.cos(angle) * dodgeDistance,
  1473.                     0,
  1474.                     math.sin(angle) * dodgeDistance
  1475.                 );
  1476.             end;
  1477.  
  1478.             local direction = (CommandData.dodgePos - currentPos).Unit;
  1479.             local newPos = currentPos + (direction * 2);
  1480.  
  1481.             Player.Character.PrimaryPart.CFrame = CFrame.new(newPos);
  1482.             workspace.Gravity = 0;
  1483.         end);
  1484.     end;
  1485.  
  1486.     --if Command == "tag" then
  1487.     --  if BOT.State._activeCommands[Command] then return end;
  1488.  
  1489.     --  local User = GetArguments(Arguments, CommandSchema);
  1490.  
  1491.     --  User = CheckType("player", User, Executor);
  1492.     --  if not User or not IsCharacterGood(User) then return end;
  1493.  
  1494.     --  BOT.State._activeCommands[Command] = {
  1495.     --      it = 1, -- Bot 1 starts as "it"
  1496.     --  };
  1497.     --  local CommandData = BOT.State._activeCommands[Command];
  1498.  
  1499.     --  CommandData.signal = RunService.RenderStepped:Connect(function()
  1500.     --      if not IsCharacterGood(Player) then return end;
  1501.  
  1502.     --      local bots = GetOrderedBots();
  1503.     --      local itBot = bots[CommandData.it];
  1504.  
  1505.     --      if BOT.ORDER == CommandData.it then
  1506.     --          -- Chase random bot
  1507.     --          local target = bots[math.random(1, #bots)];
  1508.     --          if target ~= Player and IsCharacterGood(target) then
  1509.     --              local currentPos = Player.Character.PrimaryPart.Position;
  1510.     --              local targetPos = target.Character.PrimaryPart.Position;
  1511.     --              local direction = (targetPos - currentPos).Unit;
  1512.  
  1513.     --              Player.Character.PrimaryPart.CFrame = CFrame.new(currentPos + direction * 1.5, targetPos);
  1514.  
  1515.     --              -- Tag if close enough
  1516.     --              if (targetPos - currentPos).Magnitude < 5 then
  1517.     --                  CommandData.it = TableFind(bots, target, "v");
  1518.     --              end;
  1519.     --          end;
  1520.     --      else
  1521.     --          -- Run away from "it"
  1522.     --          if itBot and IsCharacterGood(itBot) then
  1523.     --              local currentPos = Player.Character.PrimaryPart.Position;
  1524.     --              local itPos = itBot.Character.PrimaryPart.Position;
  1525.     --              local direction = (currentPos - itPos).Unit;
  1526.  
  1527.     --              Player.Character.PrimaryPart.CFrame = CFrame.new(currentPos + direction * 1, currentPos + direction);
  1528.     --          end;
  1529.     --      end;
  1530.  
  1531.     --      workspace.Gravity = 0;
  1532.     --  end);
  1533.     --end;
  1534.  
  1535.     if Command == "bridge" then
  1536.         if BOT.State._activeCommands[Command] then return end;
  1537.  
  1538.         local User1, User2, ArcHeight = GetArguments(Arguments, CommandSchema);
  1539.  
  1540.         User1 = CheckType("player", User1, Executor);
  1541.         User2 = CheckType("player", User2, Executor);
  1542.  
  1543.         if not User1 or not User2 or not IsCharacterGood(User1) or not IsCharacterGood(User2) then return end;
  1544.  
  1545.         BOT.State._activeCommands[Command] = {};
  1546.         local CommandData = BOT.State._activeCommands[Command];
  1547.  
  1548.         CommandData.signal = RunService.RenderStepped:Connect(function()
  1549.             if not IsCharacterGood(Player) then return end;
  1550.             if not IsCharacterGood(User1) or not IsCharacterGood(User2) then return end;
  1551.  
  1552.             local Pos1 = User1.Character.PrimaryPart.Position;
  1553.             local Pos2 = User2.Character.PrimaryPart.Position;
  1554.             local botCount = #LIBRARY.TYPES.bot();
  1555.  
  1556.             local t = BOT.ORDER / (botCount + 1);
  1557.             local bridgePos = Pos1:Lerp(Pos2, t);
  1558.  
  1559.             -- Arc upward in the middle
  1560.             local arcHeight = math.sin(t * math.pi) * ArcHeight;
  1561.             bridgePos = bridgePos + Vector3.new(0, arcHeight, 0);
  1562.  
  1563.             Player.Character.PrimaryPart.CFrame = CFrame.new(bridgePos, Pos2);
  1564.             workspace.Gravity = 0;
  1565.         end);
  1566.     end;
  1567.  
  1568.     if Command == "throne" then
  1569.         if BOT.State._activeCommands[Command] then return end;
  1570.  
  1571.         local User, Height = GetArguments(Arguments, CommandSchema);
  1572.  
  1573.         User = CheckType("player", User, Executor);
  1574.         if not User or not IsCharacterGood(User) then return end;
  1575.  
  1576.         Height = CheckType("int", Height) or 15;
  1577.  
  1578.         BOT.State._activeCommands[Command] = {};
  1579.         local CommandData = BOT.State._activeCommands[Command];
  1580.  
  1581.         CommandData.signal = RunService.RenderStepped:Connect(function()
  1582.             if not IsCharacterGood(Player) then return end;
  1583.             if not IsCharacterGood(User) then return end;
  1584.  
  1585.             local UserPos = User.Character.PrimaryPart.Position;
  1586.             local botCount = #LIBRARY.TYPES.bot();
  1587.  
  1588.             -- Create pyramid steps leading up
  1589.             local layer = math.floor((BOT.ORDER - 1) / 4);
  1590.             local posInLayer = (BOT.ORDER - 1) % 4;
  1591.  
  1592.             local angles = {0, math.pi/2, math.pi, math.pi*3/2};
  1593.             local angle = angles[posInLayer + 1];
  1594.             local radius = 8 - (layer * 2);
  1595.  
  1596.             local offset = Vector3.new(
  1597.                 math.cos(angle) * radius,
  1598.                 layer * 3,
  1599.                 math.sin(angle) * radius
  1600.             );
  1601.  
  1602.             Player.Character.PrimaryPart.CFrame = CFrame.new(UserPos + offset, UserPos);
  1603.  
  1604.             workspace.Gravity = 0;
  1605.         end);
  1606.     end;
  1607.  
  1608.     if Command == "rain" then
  1609.         if BOT.State._activeCommands[Command] then return end;
  1610.  
  1611.         local User, Height, Spread = GetArguments(Arguments, CommandSchema);
  1612.  
  1613.         User = CheckType("player", User, Executor);
  1614.         if not User or not IsCharacterGood(User) then return end;
  1615.  
  1616.         Height = CheckType("int", Height) or 50;
  1617.         Spread = CheckType("int", Spread) or 30;
  1618.  
  1619.         BOT.State._activeCommands[Command] = {
  1620.             startTime = os.clock() + ((BOT.ORDER - 1) * 1), -- Stagger start times
  1621.             dropDuration = 1,
  1622.             randomX = (math.random() - 0.5) * Spread,
  1623.             randomZ = (math.random() - 0.5) * Spread,
  1624.         };
  1625.         local CommandData = BOT.State._activeCommands[Command];
  1626.  
  1627.         CommandData.signal = RunService.RenderStepped:Connect(function()
  1628.             if not IsCharacterGood(Player) then return end;
  1629.             if not IsCharacterGood(User) then return end;
  1630.  
  1631.             local currentTime = os.clock();
  1632.             local UserPos = User.Character.PrimaryPart.Position;
  1633.  
  1634.             -- Calculate drop cycle
  1635.             local timeSinceStart = currentTime - CommandData.startTime;
  1636.             local cycleTime = timeSinceStart % (CommandData.dropDuration + 0.5);
  1637.  
  1638.             if cycleTime < CommandData.dropDuration then
  1639.                 -- Falling phase
  1640.                 local fallProgress = cycleTime / CommandData.dropDuration;
  1641.                 local currentHeight = Height * (1 - fallProgress);
  1642.  
  1643.                 local dropPosition = UserPos + Vector3.new(
  1644.                     CommandData.randomX,
  1645.                     currentHeight,
  1646.                     CommandData.randomZ
  1647.                 );
  1648.  
  1649.                 Player.Character.PrimaryPart.CFrame = CFrame.new(dropPosition);
  1650.             else
  1651.                 -- Reset phase - pick new random position
  1652.                 CommandData.randomX = (math.random() - 0.5) * Spread;
  1653.                 CommandData.randomZ = (math.random() - 0.5) * Spread;
  1654.  
  1655.                 local resetPosition = UserPos + Vector3.new(
  1656.                     CommandData.randomX,
  1657.                     Height,
  1658.                     CommandData.randomZ
  1659.                 );
  1660.  
  1661.                 Player.Character.PrimaryPart.CFrame = CFrame.new(resetPosition);
  1662.             end;
  1663.  
  1664.             workspace.Gravity = 196.2;
  1665.         end);
  1666.     end;
  1667.  
  1668.     if Command == "whirlpool" then
  1669.         if BOT.State._activeCommands[Command] then return end;
  1670.  
  1671.         local User, Speed = GetArguments(Arguments, CommandSchema);
  1672.  
  1673.         User = CheckType("player", User, Executor);
  1674.         if not User or not IsCharacterGood(User) then return end;
  1675.  
  1676.         Speed = CheckType("int", Speed) or 3;
  1677.  
  1678.         BOT.State._activeCommands[Command] = {
  1679.             clock = os.clock(),
  1680.         };
  1681.         local CommandData = BOT.State._activeCommands[Command];
  1682.  
  1683.         CommandData.signal = RunService.RenderStepped:Connect(function()
  1684.             if not IsCharacterGood(Player) then return end;
  1685.             if not IsCharacterGood(User) then return end;
  1686.  
  1687.             local TimePassed = os.clock() - CommandData.clock;
  1688.             local UserPos = User.Character.PrimaryPart.Position;
  1689.             local botCount = #LIBRARY.TYPES.bot();
  1690.  
  1691.             local phase = (BOT.ORDER / botCount) * math.pi * 2;
  1692.             local spiral = TimePassed * Speed + phase;
  1693.             local radius = 20 - (TimePassed % 5) * 4;
  1694.             local height = -(TimePassed % 5) * 5;
  1695.  
  1696.             local offset = Vector3.new(
  1697.                 math.cos(spiral) * radius,
  1698.                 height,
  1699.                 math.sin(spiral) * radius
  1700.             );
  1701.  
  1702.             Player.Character.PrimaryPart.CFrame = CFrame.new(UserPos + offset, UserPos);
  1703.             workspace.Gravity = 0;
  1704.         end);
  1705.     end;
  1706.  
  1707.     if Command == "fireworks" then
  1708.         if BOT.State._activeCommands[Command] then return end;
  1709.  
  1710.         local User, Delay = GetArguments(Arguments, CommandSchema);
  1711.  
  1712.         User = CheckType("player", User, Executor);
  1713.         if not User or not IsCharacterGood(User) then return end;
  1714.  
  1715.         Delay = CheckType("int", Delay) or 3;
  1716.  
  1717.         BOT.State._activeCommands[Command] = {
  1718.             clock = os.clock(),
  1719.             launched = false,
  1720.         };
  1721.         local CommandData = BOT.State._activeCommands[Command];
  1722.  
  1723.         CommandData.signal = RunService.RenderStepped:Connect(function()
  1724.             if not IsCharacterGood(Player) then return end;
  1725.             if not IsCharacterGood(User) then return end;
  1726.  
  1727.             local TimePassed = os.clock() - CommandData.clock;
  1728.             local UserPos = User.Character.PrimaryPart.Position;
  1729.  
  1730.             if TimePassed < 1 then
  1731.                 -- Launch phase - go straight up
  1732.                 Player.Character.PrimaryPart.CFrame = CFrame.new(UserPos + Vector3.new(0, TimePassed * 30, 0));
  1733.             elseif not CommandData.launched then
  1734.                 -- Explosion phase
  1735.                 CommandData.launched = true;
  1736.                 local botCount = #LIBRARY.TYPES.bot();
  1737.                 local angle = (BOT.ORDER / botCount) * math.pi * 2;
  1738.                 CommandData.direction = Vector3.new(math.cos(angle), 0.5, math.sin(angle)).Unit;
  1739.             else
  1740.                 -- Spread out
  1741.                 local explosionTime = TimePassed - 1;
  1742.                 local spread = explosionTime * 15;
  1743.                 Player.Character.PrimaryPart.CFrame = CFrame.new(
  1744.                     UserPos + Vector3.new(0, 30, 0) + (CommandData.direction * spread)
  1745.                 );
  1746.             end;
  1747.  
  1748.             workspace.Gravity = 0;
  1749.         end);
  1750.     end;
  1751.    
  1752.     if Command == "atom" then
  1753.         if BOT.State._activeCommands[Command] then return end;
  1754.  
  1755.         local User, Shells = GetArguments(Arguments, CommandSchema);
  1756.  
  1757.         User = CheckType("player", User, Executor);
  1758.         if not User or not IsCharacterGood(User) then return end;
  1759.  
  1760.         Shells = CheckType("int", Shells) or 3;
  1761.  
  1762.         BOT.State._activeCommands[Command] = {
  1763.             clock = os.clock(),
  1764.         };
  1765.         local CommandData = BOT.State._activeCommands[Command];
  1766.  
  1767.         CommandData.signal = RunService.RenderStepped:Connect(function()
  1768.             if not IsCharacterGood(Player) then return end;
  1769.             if not IsCharacterGood(User) then return end;
  1770.  
  1771.             local TimePassed = os.clock() - CommandData.clock;
  1772.             local UserPos = User.Character.PrimaryPart.Position;
  1773.             local botCount = #LIBRARY.TYPES.bot();
  1774.  
  1775.             -- Assign bots to electron shells
  1776.             local botsPerShell = math.ceil(botCount / Shells);
  1777.             local shell = math.floor((BOT.ORDER - 1) / botsPerShell) + 1;
  1778.             local posInShell = (BOT.ORDER - 1) % botsPerShell;
  1779.  
  1780.             local radius = shell * 8;
  1781.             local speed = 3 / shell; -- Inner shells orbit faster
  1782.             local angle = (TimePassed * speed) + ((posInShell / botsPerShell) * math.pi * 2);
  1783.  
  1784.             -- Random orbital plane tilt for each shell
  1785.             local tilt = (shell * 0.7) % (math.pi * 2);
  1786.  
  1787.             local offset = Vector3.new(
  1788.                 math.cos(angle) * radius * math.cos(tilt),
  1789.                 math.sin(angle) * radius,
  1790.                 math.cos(angle) * radius * math.sin(tilt)
  1791.             );
  1792.  
  1793.             Player.Character.PrimaryPart.CFrame = CFrame.new(UserPos + offset);
  1794.             workspace.Gravity = 0;
  1795.         end);
  1796.     end;
  1797.  
  1798.     if Command == "clockwork" then
  1799.         if BOT.State._activeCommands[Command] then return end;
  1800.  
  1801.         local User, Speed = GetArguments(Arguments, CommandSchema);
  1802.  
  1803.         User = CheckType("player", User, Executor);
  1804.         if not User or not IsCharacterGood(User) then return end;
  1805.  
  1806.         Speed = CheckType("int", Speed) or 2;
  1807.  
  1808.         BOT.State._activeCommands[Command] = {
  1809.             clock = os.clock(),
  1810.         };
  1811.         local CommandData = BOT.State._activeCommands[Command];
  1812.  
  1813.         CommandData.signal = RunService.RenderStepped:Connect(function()
  1814.             if not IsCharacterGood(Player) then return end;
  1815.             if not IsCharacterGood(User) then return end;
  1816.  
  1817.             local TimePassed = os.clock() - CommandData.clock;
  1818.             local UserPos = User.Character.PrimaryPart.Position;
  1819.             local botCount = #LIBRARY.TYPES.bot();
  1820.  
  1821.             -- Create gear teeth arrangement
  1822.             local gearIndex = math.floor((BOT.ORDER - 1) / 8);
  1823.             local toothIndex = (BOT.ORDER - 1) % 8;
  1824.  
  1825.             local gearRadius = 8 + (gearIndex * 8);
  1826.             local rotationSpeed = Speed * (gearIndex % 2 == 0 and 1 or -1); -- Alternate direction
  1827.             local angle = (TimePassed * rotationSpeed) + ((toothIndex / 8) * math.pi * 2);
  1828.  
  1829.             -- Add tooth protrusion
  1830.             local toothExtension = math.abs(math.sin(toothIndex * math.pi / 4)) * 2;
  1831.             local effectiveRadius = gearRadius + toothExtension;
  1832.  
  1833.             local offset = Vector3.new(
  1834.                 math.cos(angle) * effectiveRadius,
  1835.                 gearIndex * 5,
  1836.                 math.sin(angle) * effectiveRadius
  1837.             );
  1838.  
  1839.             Player.Character.PrimaryPart.CFrame = CFrame.new(UserPos + offset);
  1840.             workspace.Gravity = 0;
  1841.         end);
  1842.     end;
  1843.  
  1844.     if Command == "kaleidoscope" then
  1845.         if BOT.State._activeCommands[Command] then return end;
  1846.  
  1847.         local User, Speed, Segments = GetArguments(Arguments, CommandSchema);
  1848.  
  1849.         User = CheckType("player", User, Executor);
  1850.         if not User or not IsCharacterGood(User) then return end;
  1851.  
  1852.         Speed = CheckType("int", Speed) or 3;
  1853.         Segments = CheckType("int", Segments) or 6;
  1854.  
  1855.         BOT.State._activeCommands[Command] = {
  1856.             clock = os.clock(),
  1857.         };
  1858.         local CommandData = BOT.State._activeCommands[Command];
  1859.  
  1860.         CommandData.signal = RunService.RenderStepped:Connect(function()
  1861.             if not IsCharacterGood(Player) then return end;
  1862.             if not IsCharacterGood(User) then return end;
  1863.  
  1864.             local TimePassed = os.clock() - CommandData.clock;
  1865.             local UserPos = User.Character.PrimaryPart.Position;
  1866.             local botCount = #LIBRARY.TYPES.bot();
  1867.  
  1868.             -- Create mirrored pattern segments
  1869.             local segmentSize = math.ceil(botCount / Segments);
  1870.             local segment = math.floor((BOT.ORDER - 1) / segmentSize);
  1871.             local posInSegment = (BOT.ORDER - 1) % segmentSize;
  1872.  
  1873.             local baseAngle = (segment / Segments) * math.pi * 2;
  1874.             local rotation = TimePassed * Speed;
  1875.  
  1876.             -- Pattern within segment
  1877.             local patternRadius = 5 + (posInSegment % 3) * 5;
  1878.             local patternAngle = ((posInSegment / segmentSize) * math.pi / 3) + rotation;
  1879.  
  1880.             local x = math.cos(baseAngle + patternAngle) * patternRadius;
  1881.             local z = math.sin(baseAngle + patternAngle) * patternRadius;
  1882.             local y = math.sin(rotation + posInSegment) * 5;
  1883.  
  1884.             local offset = Vector3.new(x, y, z);
  1885.  
  1886.             Player.Character.PrimaryPart.CFrame = CFrame.new(UserPos + offset, UserPos);
  1887.             workspace.Gravity = 0;
  1888.         end);
  1889.     end;
  1890. end;
  1891.  
  1892. function ConnectPlayer(_Player)
  1893.     _Player.Chatted:Connect(function(Message)
  1894.         if not BOT.State._enabled then return end;
  1895.         ProcessCommand(_Player, Message);
  1896.     end);
  1897. end;
  1898.  
  1899. for _, _Player in LIBRARY.TYPES.player() do
  1900.     BOT.ORDER = TableFind(GetOrderedBots(), Player, "v");
  1901.     if not table.find(LIBRARY.OPERATORS, _Player.UserId) then continue end;
  1902.     ConnectPlayer(_Player);
  1903. end;
  1904. Players.PlayerAdded:Connect(function(_Player)
  1905.     BOT.ORDER = TableFind(GetOrderedBots(), Player, "v");
  1906.     if not table.find(LIBRARY.OPERATORS, _Player.UserId) then return end;
  1907.     ConnectPlayer(_Player);
  1908. end);
  1909. Players.PlayerRemoving:Connect(function(_Player)
  1910.     BOT.ORDER = TableFind(GetOrderedBots(), Player, "v");
  1911. end);
  1912.  
  1913. if LIBRARY.AFTER_LOADED_RUN then
  1914.     ProcessCommand(Player, LIBRARY.AFTER_LOADED_RUN);
  1915. end;
Add Comment
Please, Sign In to add comment