Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --by Rylvns
- --last edited 1/5/26
- --!native
- --!optimize 2
- type LIBRARY = {
- BOTS: {number},
- OPERATORS: {number},
- CONFIG: {
- OPTIMIZE: number,
- COMMAND_SEPERATOR: string,
- STACKING_SEPERATOR: string,
- },
- COMMANDS: {[string]: {any}},
- TYPES: {
- player: ()->{Player},
- bot: ()->{Player},
- string: (string|number)->boolean,
- int: (number|string)->boolean,
- boolean: (string)->boolean,
- },
- LYRICS: {[string]: {any}},
- AFTER_LOADED_RUN: string,
- };
- type BOT = {
- ID: number,
- ORDER: number,
- };
- local LIBRARY: LIBRARY = shared.LIBRARY;
- local BOT: BOT = shared.BOT;
- BOT.State = {
- _enabled = true,
- _activeCommands = {},
- _lastMessage = "",
- _defaultGravity = workspace.Gravity,
- };
- local EncodingService = game:GetService("EncodingService");
- local HttpService = game:GetService("HttpService");
- local UserService = game:GetService("UserService");
- local RunService = game:GetService("RunService");
- local Players = game:GetService("Players");
- local Player = Players.LocalPlayer;
- local Camera = workspace.CurrentCamera;
- local TextChatService = game:GetService("TextChatService");
- local ReplicatedStorage = game:GetService("ReplicatedStorage");
- Player.Idled:Connect(function()
- game:GetService("VirtualUser"):CaptureController();
- game:GetService("VirtualUser"):ClickButton2(Vector2.new());
- end);
- local function Or(A, ...)
- for _, Value in {...} do
- if Value ~= A then continue end;
- return true;
- end;
- return false;
- end;
- local function TableFind(Table, Clue, Search)
- for Index, Value in Table do
- if Search == "v" and Value == Clue then
- return Index;
- elseif Search == "i" and Index == Clue then
- return Value;
- end;
- end;
- return nil;
- end;
- function RemoveExtraSpaces(String)
- while string.find(String, " ") do
- String = string.gsub(String, " ", " ");
- end;
- return String;
- end;
- function Say(String)
- if Or(RemoveExtraSpaces(String), "", " ") then return end;
- if ReplicatedStorage:FindFirstChild("DefaultChatSystemChatEvents") then
- ReplicatedStorage.DefaultChatSystemChatEvents.SayMessageRequest:FireServer(String, "All");
- else
- TextChatService.TextChannels.RBXGeneral:SendAsync(String);
- end;
- end;
- --"hello:there" ignores quotes
- local function GetArguments(String, ArgumentsSchema)
- local Arguments = {};
- local Tokens = {};
- local InQuotes = false;
- local QuoteCharacter = nil;
- local CurrentToken = "";
- for Index = 1, #String do
- local Character = string.sub(String, Index, Index);
- if Or(Character, `"`, `'`) and not InQuotes then
- InQuotes = true;
- QuoteCharacter = Character;
- elseif Character == QuoteCharacter and InQuotes then
- InQuotes = false;
- Tokens[#Tokens+1] = CurrentToken;
- CurrentToken = "";
- QuoteCharacter = nil;
- elseif Character == LIBRARY.CONFIG.COMMAND_SEPERATOR and not InQuotes then
- if #CurrentToken > 0 then
- Tokens[#Tokens+1] = CurrentToken;
- CurrentToken = "";
- end;
- else
- CurrentToken ..= Character;
- end;
- end;
- if #CurrentToken > 0 then
- Tokens[#Tokens+1] = CurrentToken;
- end;
- local NamedArgs = {};
- local OrderedArgs = {};
- for _, Token in ipairs(Tokens) do
- local ColonPos = string.find(Token, ":");
- if ColonPos then
- local ArgName = string.sub(Token, 1, ColonPos-1);
- local ArgValue = string.sub(Token, ColonPos+1);
- NamedArgs[ArgName] = ArgValue;
- else
- OrderedArgs[#OrderedArgs+1] = Token;
- end;
- end;
- local Results = {};
- local UsedPositions = {};
- for Index, Schema in ipairs(ArgumentsSchema) do
- if NamedArgs[Schema.name] then
- Results[Index] = NamedArgs[Schema.name];
- UsedPositions[Index] = true;
- end;
- end;
- local OrderedIndex = 1;
- for Index, Schema in ipairs(ArgumentsSchema) do
- if not UsedPositions[Index] and OrderedArgs[OrderedIndex] then
- Results[Index] = OrderedArgs[OrderedIndex];
- OrderedIndex+= 1;
- end;
- end;
- return table.unpack(Results, 1, #ArgumentsSchema);
- end;
- local function SplitCommand(String)
- local FirstSep = string.find(String, LIBRARY.CONFIG.COMMAND_SEPERATOR);
- if FirstSep then
- local Command = string.sub(String, 1, FirstSep-1);
- local Arguments = string.sub(String, FirstSep+#LIBRARY.CONFIG.COMMAND_SEPERATOR);
- return Command, Arguments;
- else
- return String;
- end;
- end;
- function GetOrderedBots()
- local Bots = {};
- for _, BotUserId in LIBRARY.BOTS do
- local Bot = Players:GetPlayerByUserId(BotUserId);
- if Bot then
- table.insert(Bots, Bot);
- end;
- end;
- return Bots;
- end;
- function CheckType(Type, Value, Executor)
- local TypeHandler = LIBRARY.TYPES[Type];
- if not TypeHandler then return end;
- if Or(Type, "player", "bot") then
- local LowerString = string.lower(Value);
- if LowerString == "all" then
- return Player;
- elseif LowerString == "me" then--disallow for bot type?
- return Executor;
- elseif LowerString == "random" then
- local List = TypeHandler();
- return List[math.random(1, #List)];
- elseif LowerString == "closest" then
- if not Executor or not Executor.Character then return end;
- return GetClosestPlayer(TypeHandler(), Executor.Character:GetPivot().Position);
- end;
- local Matches = {};
- for _, _Player in TypeHandler() do
- if not string.find(string.lower(_Player.Name), LowerString) and not string.find(string.lower(_Player.DisplayName), LowerString) then continue end;
- table.insert(Matches, _Player);
- end;
- if #Matches == 1 then
- return Matches[1];
- end;
- elseif Type == "int" then
- if TypeHandler(Value) then
- return tonumber(Value);
- end;
- elseif Type == "boolean" then
- return TypeHandler(Value);
- end;
- end;
- function GetClosestPlayer(_Players, Origin)
- local Lowest = math.huge;
- local Closest = nil;
- for _, _Player in _Players do
- if _Player == Player then continue end;
- if not _Player.Character then continue end;
- local RootPart = _Player.Character.PrimaryPart;
- if not RootPart then continue end;
- local Distance = (Origin-RootPart.Position).Magnitude;
- if Distance < Lowest then
- Lowest, Closest = Distance, _Player;
- end;
- end;
- return Closest;
- end;
- function GetRandomPlayer()
- local _Players = LIBRARY.TYPES.player();
- return _Players[Random.new():NextInteger(1, #_Players)];
- end;
- function IsCharacterGood(_Player)
- return _Player.Character and _Player.Character.PrimaryPart ~= nil;
- end;
- local function RandomPointOnSphere(Center, Radius)
- local Theta = math.random()*math.pi*2;
- local Phi = math.acos(2*math.random()-1);
- local X = Radius*math.sin(Phi)*math.cos(Theta);
- local Y = Radius*math.sin(Phi)*math.sin(Theta);
- local Z = Radius*math.cos(Phi);
- return Center+Vector3.new(X, Y, Z);
- end;
- local function CleanCommandData(CommandData)
- if CommandData.tasks then
- for _, Task in CommandData.tasks do
- task.cancel(Task);
- end;
- end;
- if CommandData.task then
- task.cancel(CommandData.task);
- end;
- if CommandData.coroutines then
- for _, Coroutine in CommandData.coroutines do
- coroutine.close(Coroutine :: thread);
- end;
- end;
- if CommandData.coroutine then
- coroutine.close(CommandData.coroutine);
- end;
- if CommandData.coroutineYield then
- coroutine.resume(CommandData.coroutineYield);
- end;
- if CommandData.signal then
- CommandData.signal:Disconnect();
- end;
- if CommandData.object then
- CommandData.object:Destroy();
- end;
- end;
- function ProcessCommand(Executor, Message)
- if not BOT.State._enabled then return end;
- if string.find(Message, "=", #Message-3) then
- local DecodedBuffer = EncodingService:Base64Decode(buffer.fromstring(Message));
- Message = buffer.tostring(DecodedBuffer);
- end;
- Message = Message:lower();
- local Command, Arguments = SplitCommand(Message);
- local CommandSchema = LIBRARY.COMMANDS[Command];
- if not CommandSchema then
- BOT.State._lastMessage = Message;
- if BOT.State._activeCommands.mock then
- if BOT.State._activeCommands.mock.user ~= Executor then return end;
- Say(Message);
- end;
- return;
- end;
- if Command == "chat" then
- local String, A = GetArguments(Arguments, CommandSchema);
- local ArgSchema = CommandSchema[1].expects[String];
- if not ArgSchema then
- Say(String);
- return;
- end;
- if String == "fps" then
- Say(`{math.ceil(1/game.Stats.FrameTime)} fps`);
- elseif String == "ping" then
- elseif String == "id" then
- Say(`Hyperion-{BOT.ID}`);
- elseif String == "bots" then
- if not ArgSchema.expects[A] then return end;
- if A == "online" then
- Say(table.concat(LIBRARY.TYPES.bot(), ", "));
- elseif A == "offline" then
- Say("idk man");
- end;
- elseif String == "last" then
- Say(BOT.State._lastMessage);
- end;
- end;
- if Command == "spam" then
- if BOT.State._activeCommands[Command] then return end;
- local String, Count = GetArguments(Arguments, CommandSchema);
- Count = CheckType("int", Count) or 5;
- BOT.State._activeCommands[Command] = {};
- local CommandData = BOT.State._activeCommands[Command];
- CommandData.coroutine = coroutine.create(function()
- for _ = 1, Count do
- Say(String);
- task.wait(1/4);
- end;
- BOT.State._activeCommands[Command] = nil;
- end);
- coroutine.resume(CommandData.coroutine);
- end;
- if Command == "mock" then
- local User = GetArguments(Arguments, CommandSchema);
- User = CheckType("player", User, Executor);
- if not User then return end;
- BOT.State._activeCommands.mock = {user = User};
- end;
- if Command == "stop" then
- local _Command = GetArguments(Arguments, CommandSchema);
- if _Command == "all" then
- for _, CommandData in BOT.State._activeCommands do
- CleanCommandData(CommandData);
- end;
- table.clear(BOT.State._activeCommands);
- else
- local CommandData = BOT.State._activeCommands[_Command];
- if not CommandData then return end;
- CleanCommandData(CommandData);
- BOT.State._activeCommands[_Command] = nil;
- end;
- workspace.Gravity = BOT.State._defaultGravity;
- Camera.CameraSubject = Player.Character.Humanoid;
- end;
- if Command == "sing" then
- if BOT.State._activeCommands[Command] then return end
- local Song = GetArguments(Arguments, CommandSchema)
- local SongLyrics = LIBRARY.MUSIC_LYRICS[Song]
- if not SongLyrics then return end
- BOT.State._activeCommands[Command] = {coroutines = {}}
- local CommandData = BOT.State._activeCommands[Command]
- for Index, Lyric in SongLyrics do
- local ShouldSay = Lyric.all or ((Index-1)%#LIBRARY.TYPES.bot()+1 == BOT.ORDER);
- if not ShouldSay then continue end;
- CommandData.coroutines[Index] = coroutine.create(function()
- task.wait(Lyric.time);
- Say(Lyric.lyric);
- end);
- coroutine.resume(CommandData.coroutines[Index]);
- end;
- end;
- if Command == "freeze" then
- if BOT.State._activeCommands[Command] then return end;
- local Bot = GetArguments(Arguments, CommandSchema);
- Bot = CheckType("bot", Bot, Executor);
- if Bot ~= Player then return end;
- if not IsCharacterGood(Player) then return end;
- BOT.State._activeCommands[Command] = {};
- local CommandData = BOT.State._activeCommands[Command];
- CommandData.coroutineYield = coroutine.create(function()
- Player.Character.HumanoidRootPart.Anchored = true;
- coroutine.yield();
- if not IsCharacterGood(Player) then return end;
- Player.Character.HumanoidRootPart.Anchored = false;
- end);
- coroutine.resume(CommandData.coroutineYield);
- end;
- if Command == "tp" then
- local Bot, User = GetArguments(Arguments, CommandSchema);
- Bot = CheckType("bot", Bot, Executor);
- if Bot ~= Player then return end;
- if not IsCharacterGood(Player) then return end;
- User = CheckType("player", User, Executor);
- if not User then return end;
- if not IsCharacterGood(User) then return end;
- Player.Character.PrimaryPart.CFrame = User.Character:GetPivot();
- end;
- if Command == "raid" then
- if BOT.State._activeCommands[Command] then return end;
- if not IsCharacterGood(Player) then return end;
- local Interval = GetArguments(Arguments, CommandSchema);
- Interval = CheckType("int", Interval) or 1;
- local Random = Random.new();
- BOT.State._activeCommands[Command] = {
- target = nil,
- clock = 0,
- };
- local CommandData = BOT.State._activeCommands[Command];
- CommandData.signal = RunService.RenderStepped:Connect(function()
- local CurrentClock = os.clock();
- if CurrentClock-CommandData.clock >= Interval then
- local _Players = LIBRARY.TYPES.player();
- CommandData.target = _Players[Random:NextInteger(1, #_Players)];
- if not IsCharacterGood(CommandData.target) then return end;
- CommandData.clock = CurrentClock;
- end;
- if not IsCharacterGood(Player) then return end;
- Player.Character.HumanoidRootPart.CFrame = CommandData.target.Character:GetPivot();
- end);
- end;
- if Command == "line" then
- local User, Rows, SpacingX, SpacingZ = GetArguments(Arguments, CommandSchema);
- User = CheckType("player", User, Executor);
- if not User or not IsCharacterGood(User) then return end;
- local NumBots = #LIBRARY.TYPES.bot();
- Rows = CheckType("int", Rows) or 5;
- Rows = NumBots < Rows and NumBots or Rows;
- SpacingX = CheckType("int", SpacingX) or 4;
- SpacingZ = CheckType("int", SpacingZ) or 2;
- local LastCFrame = User.Character.PrimaryPart.CFrame*CFrame.new(-(SpacingX*(Rows/2))-(SpacingX/2), 0, SpacingZ);
- local Row = math.floor((BOT.ORDER-1)/Rows);
- local Col = (BOT.ORDER-1)%Rows;
- Player.Character.PrimaryPart.CFrame = LastCFrame*CFrame.new(Col*SpacingX+SpacingX, 0, Row*SpacingZ);
- end;
- if Command == "align" then
- local Shape, Size = GetArguments(Arguments, CommandSchema);
- Size = CheckType("int", Size) or 10;
- end;
- if Command == "orbit" then
- if BOT.State._activeCommands[Command] then return end;
- local User, Radius, Speed, Sit, Facing, Mode = GetArguments(Arguments, CommandSchema);
- User = CheckType("player", User, Executor);
- if not User or not IsCharacterGood(User) then return end;
- Radius = CheckType("int", Radius) or 20;
- Speed = (CheckType("int", Speed) or 5)/10;
- Sit = not not CheckType("boolean", Sit);
- Facing = CommandSchema[5].expects[Facing] and Facing or "in";
- local Modes = {
- ["circle"] = function(a, t, i, n)
- local theta = a+(i/n)*math.pi*2;
- return CFrame.new(
- math.cos(theta)*Radius,
- 0,
- math.sin(theta)*Radius
- );
- end,
- ["wave"] = function(a, t, i, n)
- local theta = a+(i/n)*math.pi*2;
- return CFrame.new(
- math.cos(theta)*Radius,
- math.sin(theta*2)*(Radius/3),
- math.sin(theta)*Radius
- );
- end,
- ["figure8"] = function(a, t, i, n)
- local theta = a+(i/n)*math.pi*2;
- return CFrame.new(
- math.sin(theta)*Radius,
- 0,
- math.sin(theta*2)*Radius/2
- );
- end,
- ["pulse"] = function(a, t, i, n)
- local theta = a+(i/n)*math.pi*2;
- local r = Radius*(1+math.sin(t*3)*0.4);
- return CFrame.new(
- math.cos(theta)*r,
- 0,
- math.sin(theta)*r
- );
- end,
- ["bounce"] = function(a, t, i, n)
- local theta = a+(i/n)*math.pi*2;
- return CFrame.new(
- math.cos(theta)*Radius,
- math.abs(math.sin(t*2))*Radius*0.8,
- math.sin(theta)*Radius
- );
- end,
- ["zigzag"] = function(a, t, i, n)
- local theta = a+(i/n)*math.pi*2;
- local x = math.floor(theta/(math.pi/4))%2 == 0 and Radius/2 or-Radius/2;
- return CFrame.new(
- x,
- 0,
- math.sin(theta)*Radius
- );
- end,
- ["rect"] = function(a, t, i, n)
- local theta = a+(i/n)*math.pi*2
- local step = math.pi*2/4
- local r = (math.floor(theta/step)%2 == 0) and Radius or Radius*0.4
- return CFrame.new(
- math.cos(theta)*r,
- 0,
- math.sin(theta)*r
- )
- end,
- ["spiral"] = function(a, t, i, n)
- local theta = a+(i/n)*math.pi*2;
- local r = Radius*(i/n);
- return CFrame.new(
- math.cos(theta)*r,
- 0,
- math.sin(theta)*r
- );
- end,
- ["star"] = function(a, t, i, n)
- local theta = a+(i/n)*math.pi*2;
- local k = 5;
- local r = Radius*(0.5+0.5*math.cos(k*theta));
- return CFrame.new(math.cos(theta)*r, 0, math.sin(theta)*r);
- end,
- ["heart"] = function(a, t, i, n)
- local theta = a+(i/n)*math.pi*2;
- local s = Radius/18;
- local x = s*16*math.sin(theta)^3;
- local z = s*(13*math.cos(theta)-5*math.cos(2*theta)-2*math.cos(3*theta)-math.cos(4*theta));
- return CFrame.new(x, 0,-z);
- end,
- ["inf"] = function(a, t, i, n)
- local theta = a+(i/n)*math.pi*2;
- return CFrame.new(
- Radius*math.cos(theta),
- 0,
- Radius*math.sin(theta)*math.cos(theta)
- );
- end,
- ["rose"] = function(a, t, i, n)
- local theta = a+(i/n)*math.pi*2;
- local k = 4;
- local r = Radius*math.cos(k*theta);
- return CFrame.new(
- math.cos(theta)*r,
- 0,
- math.sin(theta)*r
- );
- end,
- ["polygon"] = function(a, t, i, n)
- local sides = math.max(3, math.floor(n))
- local theta = a + (i / sides) * math.pi * 2
- local step = math.pi * 2 / sides
- local ang = math.floor(theta / step) * step
- return CFrame.new(
- math.cos(ang) * Radius,
- 0,
- math.sin(ang) * Radius
- )
- end,
- ["helix"] = function(a, t, i, n)
- local theta = a + (i / n) * math.pi * 2
- return CFrame.new(
- math.cos(theta) * Radius,
- ((i / n) - 0.5) * Radius,
- math.sin(theta) * Radius
- )
- end,
- ["epicycloid"] = function(a, t, i, n)
- local theta = a + (i / n) * math.pi * 2
- local k = 3
- return CFrame.new(
- Radius * (math.cos(theta) + math.cos(k * theta)),
- 0,
- Radius * (math.sin(theta) + math.sin(k * theta))
- )
- end,
- ["hypocycloid"] = function(a, t, i, n)
- local theta = a + (i / n) * math.pi * 2
- local k = 4
- return CFrame.new(
- Radius * ((k - 1) * math.cos(theta) + math.cos((k - 1) * theta)),
- 0,
- Radius * ((k - 1) * math.sin(theta) - math.sin((k - 1) * theta))
- )
- end,
- ["logspiral"] = function(a, t, i, n)
- local theta = a + (i / n) * math.pi * 2
- local r = Radius * math.exp(0.15 * theta)
- return CFrame.new(
- math.cos(theta) * r,
- 0,
- math.sin(theta) * r
- )
- end,
- --["target"] = function(a, t, i, n)
- -- local rings = 3
- -- local ring = (i % rings) / rings
- -- local theta = a + ring * math.pi * 2
- -- return CFrame.new(
- -- math.cos(theta) * Radius * (0.4 + ring),
- -- 0,
- -- math.sin(theta) * Radius * (0.4 + ring)
- -- )
- --end,
- ["gear"] = function(a, t, i, n)
- local teeth = 8
- local theta = a + (i / n) * math.pi * 2
- local r = Radius * (1 + 0.2 * math.sin(teeth * theta))
- return CFrame.new(
- math.cos(theta) * r,
- 0,
- math.sin(theta) * r
- )
- end,
- };
- Mode = Modes[Mode] and Mode or "circle";
- BOT.State._activeCommands[Command] = { clock = os.clock() };
- local CommandData = BOT.State._activeCommands[Command];
- CommandData.object = Instance.new("Part");
- CommandData.object.Anchored = true;
- CommandData.object.CanCollide = false;
- CommandData.object.Transparency = 1;
- CommandData.object.AudioCanCollide = false;
- CommandData.object.CanTouch = false;
- CommandData.object.Parent = workspace;
- CommandData.signal = RunService.RenderStepped:Connect(function()
- if not IsCharacterGood(Player) then return end;
- if not IsCharacterGood(User) then return end;
- local botCount = #LIBRARY.TYPES.bot();
- local botIndex = BOT.ORDER;
- local TimePassed = os.clock()-CommandData.clock;
- local CurrentAngle = TimePassed*Speed;
- local Offset = Modes[Mode](CurrentAngle, TimePassed, botIndex, botCount);
- CommandData.object.CFrame = CFrame.new(User.Character.PrimaryPart.Position);
- local worldCFrame = CommandData.object.CFrame*Offset;
- local lookTarget = User.Character.PrimaryPart.Position;
- local flatLookTarget = Vector3.new(lookTarget.X, worldCFrame.Position.Y, lookTarget.Z);
- Player.Character.PrimaryPart.CFrame = CFrame.lookAt(worldCFrame.Position, flatLookTarget)*CFrame.Angles(0, Facing == "out" and math.pi or 0, 0);
- workspace.Gravity = 0;
- Player.Character.Humanoid.Sit = Sit;
- Camera.CameraSubject = CommandData.object;
- end);
- end;
- if Command == "spin" then
- if BOT.State._activeCommands[Command] then return end;
- if not IsCharacterGood(Player) then return end;
- local Speed = GetArguments(Arguments, CommandSchema);
- Speed = CheckType("int", Speed) or 90;
- BOT.State._activeCommands[Command] = {};
- local CommandData = BOT.State._activeCommands[Command];
- CommandData.object = Instance.new("BodyThrust", Player.Character.PrimaryPart);
- CommandData.object.Force = Vector3.new(Speed, 0, 0);
- CommandData.object.Location = Player.Character.PrimaryPart.Position;
- CommandData.signal = RunService.RenderStepped:Connect(function()
- if not IsCharacterGood(Player) then return end;
- Player.Character.Head.CanCollide = false;
- Player.Character.PrimaryPart.CanCollide = false;
- if Player.Character.Humanoid.RigType == Enum.HumanoidRigType.R15 then
- Player.Character.UpperTorso.CanCollide = false;
- Player.Character.LowerTorso.CanCollide = false;
- else
- Player.Character["Left Leg"].CanCollide = false;
- Player.Character["Right Leg"].CanCollide = false;
- end;
- end);
- end;
- if Command == "stack" then
- if BOT.State._activeCommands[Command] then return end;
- local User, Sit, OffsetY, OffsetZ = GetArguments(Arguments, CommandSchema);
- User = CheckType("player", User, Executor);
- if not User then return end;
- Sit = not not CheckType("boolean", Sit);
- OffsetY = CheckType("int", OffsetY) or 1.1;
- OffsetZ = CheckType("int", OffsetZ) or 1;
- BOT.State._activeCommands[Command] = {};
- local CommandData = BOT.State._activeCommands[Command];
- CommandData.signal = RunService.RenderStepped:Connect(function()
- if not IsCharacterGood(Player) then return end;
- if not IsCharacterGood(User) then return end;
- 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);
- Player.Character.Humanoid.Sit = Sit;
- workspace.Gravity = 0;
- end);
- end;
- if Command == "fling" then
- end;
- if Command == "antifling" then
- end;
- if Command == "stare" then
- local _User = GetArguments(Arguments, CommandSchema);
- local User = CheckType("player", _User, Executor);
- if not User then return end;
- BOT.State._activeCommands[Command] = {};
- local CommandData = BOT.State._activeCommands[Command];
- CommandData.signal = RunService.RenderStepped:Connect(function()
- if not IsCharacterGood(Player) then return end;
- if not IsCharacterGood(User) then return end;
- local Target = _User == "closest" and GetClosestPlayer(LIBRARY.TYPES.player(), Player.Character:GetPivot().Position) or User;
- local TargetPosition = Target.Character:GetPivot().Position;
- local PrimaryPart = Player.Character.PrimaryPart;
- local Origin = PrimaryPart.Position;
- PrimaryPart.CFrame = CFrame.new(Origin, Vector3.new(TargetPosition.X, Origin.Y, TargetPosition.Z));
- end);
- end;
- if Command == "annoy" then
- if BOT.State._activeCommands[Command] then return end;
- local User, Radius = GetArguments(Arguments, CommandSchema);
- User = CheckType("player", User, Executor);
- if not User then return end;
- Radius = CheckType("int", Radius) or 10;
- BOT.State._activeCommands[Command] = {
- clock = 0,
- position = Vector3.zero,
- };
- local CommandData = BOT.State._activeCommands[Command];
- CommandData.signal = RunService.RenderStepped:Connect(function()
- if not IsCharacterGood(Player) then return end;
- if not IsCharacterGood(User) then return end;
- local TargetPos = User.Character.PrimaryPart.Position;
- if os.clock()-CommandData.clock >= 1/10 then
- CommandData.position = RandomPointOnSphere(TargetPos, Radius);
- CommandData.clock = os.clock();
- end;
- Player.Character.PrimaryPart.CFrame = CFrame.new(CommandData.position, TargetPos);
- Player.Character.Head.CanCollide = false;
- Player.Character.PrimaryPart.CanCollide = false;
- if Player.Character.Humanoid.RigType == Enum.HumanoidRigType.R15 then
- Player.Character.UpperTorso.CanCollide = false;
- Player.Character.LowerTorso.CanCollide = false;
- else
- Player.Character["Left Leg"].CanCollide = false;
- Player.Character["Right Leg"].CanCollide = false;
- end;
- workspace.Gravity = 0;
- end);
- end;
- if Command == "rocket" then
- if not IsCharacterGood(Player) then return end;
- local User = GetArguments(Arguments, CommandSchema);
- User = CheckType("player", User, Executor);
- if User and not IsCharacterGood(User) then return end;
- local PrimaryPart = Player.Character.PrimaryPart;
- BOT.State._activeCommands[Command] = {};
- local CommandData = BOT.State._activeCommands[Command];
- CommandData.object = Instance.new("BodyThrust", PrimaryPart);
- CommandData.object.Force = Vector3.new(2000, 300, 0);
- CommandData.object.Location = PrimaryPart.Position;
- CommandData.signal = RunService.RenderStepped:Connect(function()
- if not IsCharacterGood(Player) then return end;
- Player.Character.Head.CanCollide = false;
- PrimaryPart.CanCollide = false;
- if Player.Character.Humanoid.RigType == Enum.HumanoidRigType.R15 then
- Player.Character.UpperTorso.CanCollide = false;
- Player.Character.LowerTorso.CanCollide = false;
- else
- Player.Character["Left Leg"].CanCollide = false;
- Player.Character["Right Leg"].CanCollide = false;
- end;
- end);
- CommandData.task = task.delay(1, function()
- Player.Character.Humanoid.Health = 0;
- task.wait(0.2);
- CommandData.signal:Disconnect();
- CommandData.object:Destroy();
- end);
- end;
- if Command == "roam" then
- end;
- if Command == "path" then
- end;
- if Command == "follow" then
- end;
- if Command == "server" then
- end;
- if Command == "emote" then
- end;
- if Command == "jump" then
- local Bot = GetArguments(Arguments, CommandSchema);
- Bot = CheckType("bot", Bot, Executor);
- if Bot ~= Player then return end;
- if not IsCharacterGood(Player) then return end;
- Player.Character.Humanoid.Jump = true;
- end;
- if Command == "sit" then
- local Bot = GetArguments(Arguments, CommandSchema);
- Bot = CheckType("bot", Bot, Executor);
- if Bot ~= Player then return end;
- if not IsCharacterGood(Player) then return end;
- Player.Character.Humanoid.Sit = true;
- end;
- if Command == "render" then
- local Toggle = GetArguments(Arguments, CommandSchema);
- Toggle = not not CheckType("boolean", Toggle);
- RunService:Set3dRenderingEnabled(Toggle);
- end;
- if Command == "fpscap" then
- local Cap = GetArguments(Arguments, CommandSchema);
- Cap = CheckType("int", Cap) or 60;
- if setfpscap and typeof(setfpscap) == "function" then
- setfpscap(Cap);
- end;
- end;
- if Command == "reset" then
- local Bot = GetArguments(Arguments, CommandSchema);
- Bot = CheckType("bot", Bot, Executor);
- if Bot ~= Player then return end;
- if not IsCharacterGood(Player) then return end;
- Player.Character.Humanoid.Health = 0;
- end;
- if Command == "connect" then
- local User = GetArguments(Arguments, CommandSchema);
- User = CheckType("player", User, Executor);
- if User and not IsCharacterGood(User) then return end;
- ConnectPlayer(User);
- Say(`connected {User.DisplayName}.`);
- end;
- if Command == "reload" then
- local Bot = GetArguments(Arguments, CommandSchema);
- Bot = CheckType("bot", Bot, Executor);
- if Bot ~= Player then return end;
- BOT.State._enabled = false;
- for _, CommandData in BOT.State._activeCommands do
- CleanCommandData(CommandData);
- end;
- table.clear(BOT.State._activeCommands);
- Say("reloading...");
- for Index = 1, 5 do
- local Success = pcall(function()
- loadstring(game:HttpGet("https://pastebin.com/raw/U93Pe1nz"))();
- end);
- if Success then
- Say("success.");
- break;
- else
- Say(`failed to load. retrying... ({Index}/5)`);
- end;
- task.wait(2);
- end;
- end;
- if Command == "disable" then
- local Bot = GetArguments(Arguments, CommandSchema);
- Bot = CheckType("bot", Bot, Executor);
- if Bot ~= Player then return end;
- BOT.State._enabled = false;
- for _, CommandData in BOT.State._activeCommands do
- CleanCommandData(CommandData);
- end;
- table.clear(BOT.State._activeCommands);
- Say("disabled.");
- end;
- if Command == "rejoin" then
- local Bot = GetArguments(Arguments, CommandSchema);
- Bot = CheckType("bot", Bot, Executor);
- if Bot ~= Player then return end;
- game:GetService("TeleportService"):TeleportToPlaceInstance(game.PlaceId, game.JobId, Player);
- end;
- if Command == "leave" then
- local Bot = GetArguments(Arguments, CommandSchema);
- Bot = CheckType("bot", Bot, Executor);
- if Bot ~= Player then return end;
- game:Shutdown();
- end;
- -- ai
- if Command == "swarm" then
- if BOT.State._activeCommands[Command] then return end;
- local User, Speed, Radius = GetArguments(Arguments, CommandSchema);
- User = CheckType("player", User, Executor);
- if not User or not IsCharacterGood(User) then return end;
- Speed = CheckType("int", Speed) or 5;
- Radius = CheckType("int", Radius) or 15;
- BOT.State._activeCommands[Command] = {
- clock = 0,
- position = Vector3.zero,
- randomOffset = Random.new():NextNumber(-1, 1) * math.pi * 2,
- };
- local CommandData = BOT.State._activeCommands[Command];
- CommandData.signal = RunService.RenderStepped:Connect(function()
- if not IsCharacterGood(Player) then return end;
- if not IsCharacterGood(User) then return end;
- local TimePassed = os.clock() - CommandData.clock;
- local TargetPos = User.Character.PrimaryPart.Position;
- -- Erratic movement pattern
- local angle = TimePassed * Speed + CommandData.randomOffset;
- local bobbing = math.sin(angle * 3) * 5;
- local circling = angle + math.sin(angle * 2) * 0.5;
- local offset = Vector3.new(
- math.cos(circling) * Radius,
- bobbing,
- math.sin(circling) * Radius
- );
- CommandData.position = TargetPos + offset;
- Player.Character.PrimaryPart.CFrame = CFrame.new(CommandData.position, TargetPos);
- workspace.Gravity = 0;
- end);
- end;
- if Command == "wall" then
- if BOT.State._activeCommands[Command] then return end;
- local User, Distance, Height = GetArguments(Arguments, CommandSchema);
- User = CheckType("player", User, Executor);
- if not User or not IsCharacterGood(User) then return end;
- Distance = CheckType("int", Distance) or 10;
- Height = CheckType("int", Height) or 3;
- BOT.State._activeCommands[Command] = {};
- local CommandData = BOT.State._activeCommands[Command];
- CommandData.signal = RunService.RenderStepped:Connect(function()
- if not IsCharacterGood(Player) then return end;
- if not IsCharacterGood(User) then return end;
- local botCount = #LIBRARY.TYPES.bot();
- local UserCFrame = User.Character.PrimaryPart.CFrame;
- local row = math.floor((BOT.ORDER - 1) / Height);
- local col = (BOT.ORDER - 1) % Height;
- local wallOffset = CFrame.new(
- (col - Height / 2) * 4,
- row * 4,
- -Distance
- );
- Player.Character.PrimaryPart.CFrame = UserCFrame * wallOffset;
- workspace.Gravity = 0;
- end);
- end;
- if Command == "surround" then
- if BOT.State._activeCommands[Command] then return end;
- local User, Layers = GetArguments(Arguments, CommandSchema);
- User = CheckType("player", User, Executor);
- if not User or not IsCharacterGood(User) then return end;
- Layers = CheckType("int", Layers) or 3;
- BOT.State._activeCommands[Command] = {};
- local CommandData = BOT.State._activeCommands[Command];
- CommandData.signal = RunService.RenderStepped:Connect(function()
- if not IsCharacterGood(Player) then return end;
- if not IsCharacterGood(User) then return end;
- local botCount = #LIBRARY.TYPES.bot();
- local botsPerLayer = math.ceil(botCount / Layers);
- local layer = math.floor((BOT.ORDER - 1) / botsPerLayer);
- local posInLayer = (BOT.ORDER - 1) % botsPerLayer;
- local radius = 5 + (layer * 5);
- local angle = (posInLayer / botsPerLayer) * math.pi * 2;
- local offset = Vector3.new(
- math.cos(angle) * radius,
- 0,
- math.sin(angle) * radius
- );
- local TargetPos = User.Character.PrimaryPart.Position;
- Player.Character.PrimaryPart.CFrame = CFrame.new(TargetPos + offset, TargetPos);
- end);
- end;
- if Command == "escort" then
- if BOT.State._activeCommands[Command] then return end;
- local User, Side = GetArguments(Arguments, CommandSchema);
- User = CheckType("player", User, Executor);
- if not User or not IsCharacterGood(User) then return end;
- Side = CommandSchema[2] and CommandSchema[2].expects[Side] and Side or "right";
- BOT.State._activeCommands[Command] = {};
- local CommandData = BOT.State._activeCommands[Command];
- CommandData.signal = RunService.RenderStepped:Connect(function()
- if not IsCharacterGood(Player) then return end;
- if not IsCharacterGood(User) then return end;
- local UserCFrame = User.Character.PrimaryPart.CFrame;
- local botCount = #LIBRARY.TYPES.bot();
- local row = math.floor((BOT.ORDER - 1) / 2);
- local side = (BOT.ORDER - 1) % 2 == 0 and -1 or 1;
- if Side == "front" then
- Player.Character.PrimaryPart.CFrame = UserCFrame * CFrame.new(side * 4, 0, -4 - (row * 4));
- elseif Side == "back" then
- Player.Character.PrimaryPart.CFrame = UserCFrame * CFrame.new(side * 4, 0, 4 + (row * 4));
- else -- left/right
- local xOffset = Side == "left" and -4 - (row * 4) or 4 + (row * 4);
- Player.Character.PrimaryPart.CFrame = UserCFrame * CFrame.new(xOffset, 0, side * 4);
- end;
- end);
- end;
- if Command == "tornado" then
- if BOT.State._activeCommands[Command] then return end;
- local User, Speed, Height = GetArguments(Arguments, CommandSchema);
- User = CheckType("player", User, Executor);
- if not User or not IsCharacterGood(User) then return end;
- Speed = CheckType("int", Speed) or 5;
- Height = CheckType("int", Height) or 20;
- BOT.State._activeCommands[Command] = {
- clock = os.clock(),
- };
- local CommandData = BOT.State._activeCommands[Command];
- CommandData.object = Instance.new("BodyThrust", Player.Character.PrimaryPart);
- CommandData.object.Force = Vector3.new(Speed * 100, 0, 0);
- CommandData.object.Location = Player.Character.PrimaryPart.Position;
- CommandData.signal = RunService.RenderStepped:Connect(function()
- if not IsCharacterGood(Player) then return end;
- if not IsCharacterGood(User) then return end;
- local TimePassed = os.clock() - CommandData.clock;
- local TargetPos = User.Character.PrimaryPart.Position;
- local botCount = #LIBRARY.TYPES.bot();
- local angle = TimePassed * Speed + ((BOT.ORDER / botCount) * math.pi * 2);
- local radius = 10 - (BOT.ORDER / botCount) * 8;
- local heightOffset = (BOT.ORDER / botCount) * Height;
- local offset = Vector3.new(
- math.cos(angle) * radius,
- heightOffset + math.sin(TimePassed * 2) * 3,
- math.sin(angle) * radius
- );
- Player.Character.PrimaryPart.CFrame = CFrame.new(TargetPos + offset);
- Player.Character.Head.CanCollide = false;
- Player.Character.PrimaryPart.CanCollide = false;
- workspace.Gravity = 0;
- end);
- end;
- if Command == "pyramid" then
- if BOT.State._activeCommands[Command] then return end;
- local User, Spacing = GetArguments(Arguments, CommandSchema);
- User = CheckType("player", User, Executor);
- if not User or not IsCharacterGood(User) then return end;
- Spacing = CheckType("int", Spacing) or 4;
- BOT.State._activeCommands[Command] = {};
- local CommandData = BOT.State._activeCommands[Command];
- CommandData.signal = RunService.RenderStepped:Connect(function()
- if not IsCharacterGood(Player) then return end;
- if not IsCharacterGood(User) then return end;
- local botCount = #LIBRARY.TYPES.bot();
- local level = 0;
- local posInLevel = BOT.ORDER - 1;
- local botsInLevel = 1;
- -- Calculate which level of pyramid
- local totalBots = 0;
- while totalBots + botsInLevel <= BOT.ORDER - 1 do
- totalBots = totalBots + botsInLevel;
- level = level + 1;
- botsInLevel = botsInLevel + 1;
- end;
- posInLevel = (BOT.ORDER - 1) - totalBots;
- local UserCFrame = User.Character.PrimaryPart.CFrame;
- local xOffset = (posInLevel - botsInLevel / 2) * Spacing;
- Player.Character.PrimaryPart.CFrame = UserCFrame * CFrame.new(xOffset, level * Spacing, Spacing * 2);
- workspace.Gravity = 0;
- end);
- end;
- if Command == "helix" then
- if BOT.State._activeCommands[Command] then return end;
- local User, Speed, Radius, Height = GetArguments(Arguments, CommandSchema);
- User = CheckType("player", User, Executor);
- if not User or not IsCharacterGood(User) then return end;
- Speed = CheckType("int", Speed) or 3;
- Radius = CheckType("int", Radius) or 8;
- Height = CheckType("int", Height) or 30;
- BOT.State._activeCommands[Command] = {
- clock = os.clock(),
- };
- local CommandData = BOT.State._activeCommands[Command];
- CommandData.signal = RunService.RenderStepped:Connect(function()
- if not IsCharacterGood(Player) then return end;
- if not IsCharacterGood(User) then return end;
- local TimePassed = os.clock() - CommandData.clock;
- local TargetPos = User.Character.PrimaryPart.Position;
- local botCount = #LIBRARY.TYPES.bot();
- -- Create DNA helix pattern
- local strand = (BOT.ORDER - 1) % 2; -- Which strand (0 or 1)
- local progress = ((BOT.ORDER - 1) / botCount) + (TimePassed * Speed / 10);
- local angle = progress * math.pi * 4 + (strand * math.pi);
- local heightOffset = (progress % 1) * Height - (Height / 2);
- local offset = Vector3.new(
- math.cos(angle) * Radius,
- heightOffset,
- math.sin(angle) * Radius
- );
- Player.Character.PrimaryPart.CFrame = CFrame.new(TargetPos + offset, TargetPos);
- workspace.Gravity = 0;
- end);
- end;
- if Command == "weave" then
- if BOT.State._activeCommands[Command] then return end;
- local User, Speed = GetArguments(Arguments, CommandSchema);
- User = CheckType("player", User, Executor);
- if not User or not IsCharacterGood(User) then return end;
- Speed = CheckType("int", Speed) or 3;
- BOT.State._activeCommands[Command] = {
- clock = os.clock(),
- };
- local CommandData = BOT.State._activeCommands[Command];
- CommandData.signal = RunService.RenderStepped:Connect(function()
- if not IsCharacterGood(Player) then return end;
- if not IsCharacterGood(User) then return end;
- local TimePassed = os.clock() - CommandData.clock;
- local TargetPos = User.Character.PrimaryPart.Position;
- local botCount = #LIBRARY.TYPES.bot();
- local phase = (BOT.ORDER / botCount) * math.pi * 2;
- local t = TimePassed * Speed + phase;
- -- Figure-8 weaving pattern
- local offset = Vector3.new(
- math.sin(t) * 12,
- math.sin(t * 2) * 5,
- math.cos(t) * 12
- );
- Player.Character.PrimaryPart.CFrame = CFrame.new(TargetPos + offset);
- workspace.Gravity = 0;
- end);
- end;
- if Command == "matrix" then
- if BOT.State._activeCommands[Command] then return end;
- local User, Spacing = GetArguments(Arguments, CommandSchema);
- User = CheckType("player", User, Executor);
- if not User or not IsCharacterGood(User) then return end;
- Spacing = CheckType("int", Spacing) or 5;
- BOT.State._activeCommands[Command] = {};
- local CommandData = BOT.State._activeCommands[Command];
- CommandData.signal = RunService.RenderStepped:Connect(function()
- if not IsCharacterGood(Player) then return end;
- if not IsCharacterGood(User) then return end;
- local TargetPos = User.Character.PrimaryPart.Position;
- local botCount = #LIBRARY.TYPES.bot();
- local sideLength = math.ceil(botCount ^ (1/3));
- local i = BOT.ORDER - 1;
- local x = i % sideLength;
- local y = math.floor((i / sideLength)) % sideLength;
- local z = math.floor(i / (sideLength * sideLength));
- local offset = Vector3.new(
- (x - sideLength / 2) * Spacing,
- (y - sideLength / 2) * Spacing,
- (z - sideLength / 2) * Spacing
- );
- Player.Character.PrimaryPart.CFrame = CFrame.new(TargetPos + offset, TargetPos);
- workspace.Gravity = 0;
- end);
- end;
- if Command == "pendulum" then
- if BOT.State._activeCommands[Command] then return end;
- local User, Speed, Distance = GetArguments(Arguments, CommandSchema);
- User = CheckType("player", User, Executor);
- if not User or not IsCharacterGood(User) then return end;
- Speed = CheckType("int", Speed) or 2;
- Distance = CheckType("int", Distance) or 15;
- BOT.State._activeCommands[Command] = {
- clock = os.clock(),
- };
- local CommandData = BOT.State._activeCommands[Command];
- CommandData.signal = RunService.RenderStepped:Connect(function()
- if not IsCharacterGood(Player) then return end;
- if not IsCharacterGood(User) then return end;
- local TimePassed = os.clock() - CommandData.clock;
- local TargetPos = User.Character.PrimaryPart.Position;
- local botCount = #LIBRARY.TYPES.bot();
- local phase = (BOT.ORDER / botCount) * math.pi * 2;
- local swing = math.sin(TimePassed * Speed + phase) * Distance;
- local offset = Vector3.new(swing, (BOT.ORDER - 1) * 3, 0);
- Player.Character.PrimaryPart.CFrame = CFrame.new(TargetPos + offset, TargetPos);
- workspace.Gravity = 0;
- end);
- end;
- if Command == "tunnel" then
- if BOT.State._activeCommands[Command] then return end;
- local User, Length, Width = GetArguments(Arguments, CommandSchema);
- User = CheckType("player", User, Executor);
- if not User or not IsCharacterGood(User) then return end;
- Length = CheckType("int", Length) or 30;
- Width = CheckType("int", Width) or 8;
- BOT.State._activeCommands[Command] = {};
- local CommandData = BOT.State._activeCommands[Command];
- CommandData.signal = RunService.RenderStepped:Connect(function()
- if not IsCharacterGood(Player) then return end;
- if not IsCharacterGood(User) then return end;
- local UserCFrame = User.Character.PrimaryPart.CFrame;
- local botCount = #LIBRARY.TYPES.bot();
- local botsPerRing = 8;
- local ringIndex = math.floor((BOT.ORDER - 1) / botsPerRing);
- local posInRing = (BOT.ORDER - 1) % botsPerRing;
- local angle = (posInRing / botsPerRing) * math.pi * 2;
- local zOffset = (ringIndex / math.ceil(botCount / botsPerRing)) * Length;
- local offset = CFrame.new(
- math.cos(angle) * Width,
- math.sin(angle) * Width,
- zOffset
- );
- Player.Character.PrimaryPart.CFrame = UserCFrame * offset;
- workspace.Gravity = 0;
- end);
- end;
- if Command == "protect" then
- if BOT.State._activeCommands[Command] then return end;
- local User, Enemy, Distance = GetArguments(Arguments, CommandSchema);
- User = CheckType("player", User, Executor);
- if not User or not IsCharacterGood(User) then return end;
- Enemy = CheckType("player", Enemy, Executor);
- Distance = CheckType("int", Distance) or 5;
- BOT.State._activeCommands[Command] = {};
- local CommandData = BOT.State._activeCommands[Command];
- CommandData.signal = RunService.RenderStepped:Connect(function()
- if not IsCharacterGood(Player) then return end;
- if not IsCharacterGood(User) then return end;
- local UserPos = User.Character.PrimaryPart.Position;
- local EnemyPos;
- if Enemy and IsCharacterGood(Enemy) then
- EnemyPos = Enemy.Character.PrimaryPart.Position;
- else
- -- Find closest non-user player
- Enemy = GetClosestPlayer(LIBRARY.TYPES.player(), UserPos);
- if not Enemy or not IsCharacterGood(Enemy) then return end;
- EnemyPos = Enemy.Character.PrimaryPart.Position;
- end;
- local direction = (UserPos - EnemyPos).Unit;
- local blockPos = UserPos + (direction * -Distance);
- Player.Character.PrimaryPart.CFrame = CFrame.new(blockPos, EnemyPos);
- end);
- end;
- if Command == "dodge" then
- if BOT.State._activeCommands[Command] then return end;
- local User, MinDistance = GetArguments(Arguments, CommandSchema);
- User = CheckType("player", User, Executor);
- if not User or not IsCharacterGood(User) then return end;
- MinDistance = CheckType("int", MinDistance) or 10;
- BOT.State._activeCommands[Command] = {
- dodgePos = nil,
- clock = 0,
- };
- local CommandData = BOT.State._activeCommands[Command];
- CommandData.signal = RunService.RenderStepped:Connect(function()
- if not IsCharacterGood(Player) then return end;
- if not IsCharacterGood(User) then return end;
- local currentPos = Player.Character.PrimaryPart.Position;
- local TargetPos = User.Character.PrimaryPart.Position;
- local distance = (TargetPos - currentPos).Magnitude;
- if distance < MinDistance or not CommandData.dodgePos then
- local angle = math.random() * math.pi * 2;
- local dodgeDistance = MinDistance + math.random() * 5;
- CommandData.dodgePos = TargetPos + Vector3.new(
- math.cos(angle) * dodgeDistance,
- 0,
- math.sin(angle) * dodgeDistance
- );
- end;
- local direction = (CommandData.dodgePos - currentPos).Unit;
- local newPos = currentPos + (direction * 2);
- Player.Character.PrimaryPart.CFrame = CFrame.new(newPos);
- workspace.Gravity = 0;
- end);
- end;
- --if Command == "tag" then
- -- if BOT.State._activeCommands[Command] then return end;
- -- local User = GetArguments(Arguments, CommandSchema);
- -- User = CheckType("player", User, Executor);
- -- if not User or not IsCharacterGood(User) then return end;
- -- BOT.State._activeCommands[Command] = {
- -- it = 1, -- Bot 1 starts as "it"
- -- };
- -- local CommandData = BOT.State._activeCommands[Command];
- -- CommandData.signal = RunService.RenderStepped:Connect(function()
- -- if not IsCharacterGood(Player) then return end;
- -- local bots = GetOrderedBots();
- -- local itBot = bots[CommandData.it];
- -- if BOT.ORDER == CommandData.it then
- -- -- Chase random bot
- -- local target = bots[math.random(1, #bots)];
- -- if target ~= Player and IsCharacterGood(target) then
- -- local currentPos = Player.Character.PrimaryPart.Position;
- -- local targetPos = target.Character.PrimaryPart.Position;
- -- local direction = (targetPos - currentPos).Unit;
- -- Player.Character.PrimaryPart.CFrame = CFrame.new(currentPos + direction * 1.5, targetPos);
- -- -- Tag if close enough
- -- if (targetPos - currentPos).Magnitude < 5 then
- -- CommandData.it = TableFind(bots, target, "v");
- -- end;
- -- end;
- -- else
- -- -- Run away from "it"
- -- if itBot and IsCharacterGood(itBot) then
- -- local currentPos = Player.Character.PrimaryPart.Position;
- -- local itPos = itBot.Character.PrimaryPart.Position;
- -- local direction = (currentPos - itPos).Unit;
- -- Player.Character.PrimaryPart.CFrame = CFrame.new(currentPos + direction * 1, currentPos + direction);
- -- end;
- -- end;
- -- workspace.Gravity = 0;
- -- end);
- --end;
- if Command == "bridge" then
- if BOT.State._activeCommands[Command] then return end;
- local User1, User2, ArcHeight = GetArguments(Arguments, CommandSchema);
- User1 = CheckType("player", User1, Executor);
- User2 = CheckType("player", User2, Executor);
- if not User1 or not User2 or not IsCharacterGood(User1) or not IsCharacterGood(User2) then return end;
- BOT.State._activeCommands[Command] = {};
- local CommandData = BOT.State._activeCommands[Command];
- CommandData.signal = RunService.RenderStepped:Connect(function()
- if not IsCharacterGood(Player) then return end;
- if not IsCharacterGood(User1) or not IsCharacterGood(User2) then return end;
- local Pos1 = User1.Character.PrimaryPart.Position;
- local Pos2 = User2.Character.PrimaryPart.Position;
- local botCount = #LIBRARY.TYPES.bot();
- local t = BOT.ORDER / (botCount + 1);
- local bridgePos = Pos1:Lerp(Pos2, t);
- -- Arc upward in the middle
- local arcHeight = math.sin(t * math.pi) * ArcHeight;
- bridgePos = bridgePos + Vector3.new(0, arcHeight, 0);
- Player.Character.PrimaryPart.CFrame = CFrame.new(bridgePos, Pos2);
- workspace.Gravity = 0;
- end);
- end;
- if Command == "throne" then
- if BOT.State._activeCommands[Command] then return end;
- local User, Height = GetArguments(Arguments, CommandSchema);
- User = CheckType("player", User, Executor);
- if not User or not IsCharacterGood(User) then return end;
- Height = CheckType("int", Height) or 15;
- BOT.State._activeCommands[Command] = {};
- local CommandData = BOT.State._activeCommands[Command];
- CommandData.signal = RunService.RenderStepped:Connect(function()
- if not IsCharacterGood(Player) then return end;
- if not IsCharacterGood(User) then return end;
- local UserPos = User.Character.PrimaryPart.Position;
- local botCount = #LIBRARY.TYPES.bot();
- -- Create pyramid steps leading up
- local layer = math.floor((BOT.ORDER - 1) / 4);
- local posInLayer = (BOT.ORDER - 1) % 4;
- local angles = {0, math.pi/2, math.pi, math.pi*3/2};
- local angle = angles[posInLayer + 1];
- local radius = 8 - (layer * 2);
- local offset = Vector3.new(
- math.cos(angle) * radius,
- layer * 3,
- math.sin(angle) * radius
- );
- Player.Character.PrimaryPart.CFrame = CFrame.new(UserPos + offset, UserPos);
- workspace.Gravity = 0;
- end);
- end;
- if Command == "rain" then
- if BOT.State._activeCommands[Command] then return end;
- local User, Height, Spread = GetArguments(Arguments, CommandSchema);
- User = CheckType("player", User, Executor);
- if not User or not IsCharacterGood(User) then return end;
- Height = CheckType("int", Height) or 50;
- Spread = CheckType("int", Spread) or 30;
- BOT.State._activeCommands[Command] = {
- startTime = os.clock() + ((BOT.ORDER - 1) * 1), -- Stagger start times
- dropDuration = 1,
- randomX = (math.random() - 0.5) * Spread,
- randomZ = (math.random() - 0.5) * Spread,
- };
- local CommandData = BOT.State._activeCommands[Command];
- CommandData.signal = RunService.RenderStepped:Connect(function()
- if not IsCharacterGood(Player) then return end;
- if not IsCharacterGood(User) then return end;
- local currentTime = os.clock();
- local UserPos = User.Character.PrimaryPart.Position;
- -- Calculate drop cycle
- local timeSinceStart = currentTime - CommandData.startTime;
- local cycleTime = timeSinceStart % (CommandData.dropDuration + 0.5);
- if cycleTime < CommandData.dropDuration then
- -- Falling phase
- local fallProgress = cycleTime / CommandData.dropDuration;
- local currentHeight = Height * (1 - fallProgress);
- local dropPosition = UserPos + Vector3.new(
- CommandData.randomX,
- currentHeight,
- CommandData.randomZ
- );
- Player.Character.PrimaryPart.CFrame = CFrame.new(dropPosition);
- else
- -- Reset phase - pick new random position
- CommandData.randomX = (math.random() - 0.5) * Spread;
- CommandData.randomZ = (math.random() - 0.5) * Spread;
- local resetPosition = UserPos + Vector3.new(
- CommandData.randomX,
- Height,
- CommandData.randomZ
- );
- Player.Character.PrimaryPart.CFrame = CFrame.new(resetPosition);
- end;
- workspace.Gravity = 196.2;
- end);
- end;
- if Command == "whirlpool" then
- if BOT.State._activeCommands[Command] then return end;
- local User, Speed = GetArguments(Arguments, CommandSchema);
- User = CheckType("player", User, Executor);
- if not User or not IsCharacterGood(User) then return end;
- Speed = CheckType("int", Speed) or 3;
- BOT.State._activeCommands[Command] = {
- clock = os.clock(),
- };
- local CommandData = BOT.State._activeCommands[Command];
- CommandData.signal = RunService.RenderStepped:Connect(function()
- if not IsCharacterGood(Player) then return end;
- if not IsCharacterGood(User) then return end;
- local TimePassed = os.clock() - CommandData.clock;
- local UserPos = User.Character.PrimaryPart.Position;
- local botCount = #LIBRARY.TYPES.bot();
- local phase = (BOT.ORDER / botCount) * math.pi * 2;
- local spiral = TimePassed * Speed + phase;
- local radius = 20 - (TimePassed % 5) * 4;
- local height = -(TimePassed % 5) * 5;
- local offset = Vector3.new(
- math.cos(spiral) * radius,
- height,
- math.sin(spiral) * radius
- );
- Player.Character.PrimaryPart.CFrame = CFrame.new(UserPos + offset, UserPos);
- workspace.Gravity = 0;
- end);
- end;
- if Command == "fireworks" then
- if BOT.State._activeCommands[Command] then return end;
- local User, Delay = GetArguments(Arguments, CommandSchema);
- User = CheckType("player", User, Executor);
- if not User or not IsCharacterGood(User) then return end;
- Delay = CheckType("int", Delay) or 3;
- BOT.State._activeCommands[Command] = {
- clock = os.clock(),
- launched = false,
- };
- local CommandData = BOT.State._activeCommands[Command];
- CommandData.signal = RunService.RenderStepped:Connect(function()
- if not IsCharacterGood(Player) then return end;
- if not IsCharacterGood(User) then return end;
- local TimePassed = os.clock() - CommandData.clock;
- local UserPos = User.Character.PrimaryPart.Position;
- if TimePassed < 1 then
- -- Launch phase - go straight up
- Player.Character.PrimaryPart.CFrame = CFrame.new(UserPos + Vector3.new(0, TimePassed * 30, 0));
- elseif not CommandData.launched then
- -- Explosion phase
- CommandData.launched = true;
- local botCount = #LIBRARY.TYPES.bot();
- local angle = (BOT.ORDER / botCount) * math.pi * 2;
- CommandData.direction = Vector3.new(math.cos(angle), 0.5, math.sin(angle)).Unit;
- else
- -- Spread out
- local explosionTime = TimePassed - 1;
- local spread = explosionTime * 15;
- Player.Character.PrimaryPart.CFrame = CFrame.new(
- UserPos + Vector3.new(0, 30, 0) + (CommandData.direction * spread)
- );
- end;
- workspace.Gravity = 0;
- end);
- end;
- if Command == "atom" then
- if BOT.State._activeCommands[Command] then return end;
- local User, Shells = GetArguments(Arguments, CommandSchema);
- User = CheckType("player", User, Executor);
- if not User or not IsCharacterGood(User) then return end;
- Shells = CheckType("int", Shells) or 3;
- BOT.State._activeCommands[Command] = {
- clock = os.clock(),
- };
- local CommandData = BOT.State._activeCommands[Command];
- CommandData.signal = RunService.RenderStepped:Connect(function()
- if not IsCharacterGood(Player) then return end;
- if not IsCharacterGood(User) then return end;
- local TimePassed = os.clock() - CommandData.clock;
- local UserPos = User.Character.PrimaryPart.Position;
- local botCount = #LIBRARY.TYPES.bot();
- -- Assign bots to electron shells
- local botsPerShell = math.ceil(botCount / Shells);
- local shell = math.floor((BOT.ORDER - 1) / botsPerShell) + 1;
- local posInShell = (BOT.ORDER - 1) % botsPerShell;
- local radius = shell * 8;
- local speed = 3 / shell; -- Inner shells orbit faster
- local angle = (TimePassed * speed) + ((posInShell / botsPerShell) * math.pi * 2);
- -- Random orbital plane tilt for each shell
- local tilt = (shell * 0.7) % (math.pi * 2);
- local offset = Vector3.new(
- math.cos(angle) * radius * math.cos(tilt),
- math.sin(angle) * radius,
- math.cos(angle) * radius * math.sin(tilt)
- );
- Player.Character.PrimaryPart.CFrame = CFrame.new(UserPos + offset);
- workspace.Gravity = 0;
- end);
- end;
- if Command == "clockwork" then
- if BOT.State._activeCommands[Command] then return end;
- local User, Speed = GetArguments(Arguments, CommandSchema);
- User = CheckType("player", User, Executor);
- if not User or not IsCharacterGood(User) then return end;
- Speed = CheckType("int", Speed) or 2;
- BOT.State._activeCommands[Command] = {
- clock = os.clock(),
- };
- local CommandData = BOT.State._activeCommands[Command];
- CommandData.signal = RunService.RenderStepped:Connect(function()
- if not IsCharacterGood(Player) then return end;
- if not IsCharacterGood(User) then return end;
- local TimePassed = os.clock() - CommandData.clock;
- local UserPos = User.Character.PrimaryPart.Position;
- local botCount = #LIBRARY.TYPES.bot();
- -- Create gear teeth arrangement
- local gearIndex = math.floor((BOT.ORDER - 1) / 8);
- local toothIndex = (BOT.ORDER - 1) % 8;
- local gearRadius = 8 + (gearIndex * 8);
- local rotationSpeed = Speed * (gearIndex % 2 == 0 and 1 or -1); -- Alternate direction
- local angle = (TimePassed * rotationSpeed) + ((toothIndex / 8) * math.pi * 2);
- -- Add tooth protrusion
- local toothExtension = math.abs(math.sin(toothIndex * math.pi / 4)) * 2;
- local effectiveRadius = gearRadius + toothExtension;
- local offset = Vector3.new(
- math.cos(angle) * effectiveRadius,
- gearIndex * 5,
- math.sin(angle) * effectiveRadius
- );
- Player.Character.PrimaryPart.CFrame = CFrame.new(UserPos + offset);
- workspace.Gravity = 0;
- end);
- end;
- if Command == "kaleidoscope" then
- if BOT.State._activeCommands[Command] then return end;
- local User, Speed, Segments = GetArguments(Arguments, CommandSchema);
- User = CheckType("player", User, Executor);
- if not User or not IsCharacterGood(User) then return end;
- Speed = CheckType("int", Speed) or 3;
- Segments = CheckType("int", Segments) or 6;
- BOT.State._activeCommands[Command] = {
- clock = os.clock(),
- };
- local CommandData = BOT.State._activeCommands[Command];
- CommandData.signal = RunService.RenderStepped:Connect(function()
- if not IsCharacterGood(Player) then return end;
- if not IsCharacterGood(User) then return end;
- local TimePassed = os.clock() - CommandData.clock;
- local UserPos = User.Character.PrimaryPart.Position;
- local botCount = #LIBRARY.TYPES.bot();
- -- Create mirrored pattern segments
- local segmentSize = math.ceil(botCount / Segments);
- local segment = math.floor((BOT.ORDER - 1) / segmentSize);
- local posInSegment = (BOT.ORDER - 1) % segmentSize;
- local baseAngle = (segment / Segments) * math.pi * 2;
- local rotation = TimePassed * Speed;
- -- Pattern within segment
- local patternRadius = 5 + (posInSegment % 3) * 5;
- local patternAngle = ((posInSegment / segmentSize) * math.pi / 3) + rotation;
- local x = math.cos(baseAngle + patternAngle) * patternRadius;
- local z = math.sin(baseAngle + patternAngle) * patternRadius;
- local y = math.sin(rotation + posInSegment) * 5;
- local offset = Vector3.new(x, y, z);
- Player.Character.PrimaryPart.CFrame = CFrame.new(UserPos + offset, UserPos);
- workspace.Gravity = 0;
- end);
- end;
- end;
- function ConnectPlayer(_Player)
- _Player.Chatted:Connect(function(Message)
- if not BOT.State._enabled then return end;
- ProcessCommand(_Player, Message);
- end);
- end;
- for _, _Player in LIBRARY.TYPES.player() do
- BOT.ORDER = TableFind(GetOrderedBots(), Player, "v");
- if not table.find(LIBRARY.OPERATORS, _Player.UserId) then continue end;
- ConnectPlayer(_Player);
- end;
- Players.PlayerAdded:Connect(function(_Player)
- BOT.ORDER = TableFind(GetOrderedBots(), Player, "v");
- if not table.find(LIBRARY.OPERATORS, _Player.UserId) then return end;
- ConnectPlayer(_Player);
- end);
- Players.PlayerRemoving:Connect(function(_Player)
- BOT.ORDER = TableFind(GetOrderedBots(), Player, "v");
- end);
- if LIBRARY.AFTER_LOADED_RUN then
- ProcessCommand(Player, LIBRARY.AFTER_LOADED_RUN);
- end;
Add Comment
Please, Sign In to add comment