Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add !rand, !brickcolors, !materials, updated !usage #489

Merged
merged 2 commits into from
Sep 19, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
159 changes: 128 additions & 31 deletions MainModule/Server/Commands/Players.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ return function(Vargs, env)
Desc = "["..cStr.."] "..v.Description,
Filter = cStr
})
cmdCount = cmdCount + 1
cmdCount += 1
end
end

Expand Down Expand Up @@ -128,7 +128,7 @@ return function(Vargs, env)
Remote.MakeGui(plr,"Notepad",{})
end
};

Paint = {
Prefix = Settings.PlayerPrefix;
Commands = {"paint","canvas","draw"};
Expand All @@ -150,7 +150,7 @@ return function(Vargs, env)
Functions.Hint('"'..Settings.Prefix..'cmds"',{plr})
end
};

NotifyMe = {
Prefix = Settings.PlayerPrefix;
Commands = {"notifyme"};
Expand All @@ -168,6 +168,96 @@ return function(Vargs, env)
end
};

RandomNum = {
Prefix = Settings.PlayerPrefix;
Commands = {"rand","random","randnum","dice"};
Args = {"num m";"num n"};
Description = "Generates a number using Lua's math.random";
AdminLevel = "Players";
Function = function(plr,args)
assert((not args[1]) or tonumber(args[1]), "Argument(s) provided must be numbers")
assert((not args[2]) or tonumber(args[2]), "Arguments provided must be numbers")

if args[2] then
assert(args[2] >= args[1], "Second argument n cannot be smaller than first")
Functions.Hint(math.random(args[1], args[2]), {plr})
elseif args[1] then
Functions.Hint(math.random(args[1]), {plr})
else
Functions.Hint(math.random(), {plr})
end
end
};

BrickColorList = {
Prefix = Settings.PlayerPrefix;
Commands = {"brickcolors";"colors";"colorlist"};
Args = {};
Description = "Shows you a list of Roblox BrickColors for reference";
AdminLevel = "Players";
Function = function(plr,args)
local children = {
Core.Bytecode([[Object:ResizeCanvas(false, true, false, false, 5, 5)]]);
}

local brickColorNames = {}
for i = 1, 127 do
table.insert(brickColorNames, BrickColor.palette(i).Name)
end
table.sort(brickColorNames)

for i, bc in ipairs(brickColorNames) do
bc = BrickColor.new(bc)
table.insert(children, {
Class = "TextLabel";
Size = UDim2.new(1, -10, 0, 30);
Position = UDim2.new(0, 5, 0, 30*(i-1));
BackgroundTransparency = 1;
TextXAlignment = "Left";
Text = " "..bc.Name;
ToolTip = ("RGB: %d, %d, %d | Num: %d"):format(bc.r*255, bc.g*255, bc.b*255, bc.Number);
ZIndex = 1;
Children = {
{
Class = "Frame";
BackgroundColor3 = bc.Color;
Size = UDim2.new(0, 80, 1, -4);
Position = UDim2.new(1, -82, 0, 2);
ZIndex = 2;
}
};
})
end

Remote.MakeGui(plr, "Window", {
Name = "BrickColorList";
Title = "BrickColors";
Size = {270, 300};
MinSize = {150, 100};
Content = children;
Ready = true;
})
end
};

MaterialList = {
Prefix = Settings.PlayerPrefix;
Commands = {"materials";"materiallist","mats"};
Args = {};
Description = "Shows you a list of Roblox materials for reference";
AdminLevel = "Players";
Function = function(plr,args)
local mats = {
"Brick", "Cobblestone", "Concrete", "CorrodedMetal", "DiamondPlate", "Fabric", "Foil", "ForceField", "Glass", "Granite",
"Grass", "Ice", "Marble", "Metal", "Neon", "Pebble", "Plastic", "Slate", "Sand", "SmoothPlastic", "Wood", "WoodPlanks"
}
for i, mat in ipairs(mats) do
mats[i] = {Text = mat; Desc = "Enum value: "..Enum.Material[mat].Value}
end
Remote.MakeGui(plr,"List",{Title = "Materials"; Tab = mats})
end
};

ClientTab = {
Prefix = Settings.PlayerPrefix;
Commands = {"client";"clientsettings","playersettings"};
Expand Down Expand Up @@ -294,7 +384,7 @@ return function(Vargs, env)
OnIgnore = Core.Bytecode("return false");
})

num = num+1
num += 1
if ret then
if not answered then
answered = true
Expand Down Expand Up @@ -406,39 +496,45 @@ return function(Vargs, env)
AdminLevel = "Players";
Function = function(plr,args)
local usage={
'NOTE: This info is temporary.';
'A revamped user manual is being made.';
'';
'Mouse over things in lists to expand them';
'You can also resize windows by dragging the edges';
'';
'<b>Commands:</b>';
'Timeban, Works with non-ingame players, <i>'.. Settings.Prefix ..'tban Player time(d/h/m/s)</i> | Example: <i>'.. Settings.Prefix ..'timeban Sceleratis 10h</i> (10 hours ban), d = days, h = hour, m = minutes, s = seconds';
'<b>Special Functions:</b>';
'Ex: <i>'..Settings.Prefix..'kill FUNCTION</i>, so like <i>'..Settings.Prefix..'kill '..Settings.SpecialPrefix..'all</i>';
'Put <i>/e</i> in front to silence it (<i>/e '..Settings.Prefix..'kill scel</i>) or enable chat command hiding in client settings';
'<i>'..Settings.SpecialPrefix..'me</i> - Runs a command on you';
'<i>'..Settings.SpecialPrefix..'all</i> - Runs a command on everyone';
'<i>'..Settings.SpecialPrefix..'admins</i> - Runs a command on all admins in the game';
'<i>'..Settings.SpecialPrefix..'nonadmins</i> - Same as !admins but for people who are not an admin';
'<i>'..Settings.SpecialPrefix..'others</i> - Runs command on everyone BUT you';
'<i>'..Settings.SpecialPrefix..'random</i> - Runs command on a random person';
'<i>'..Settings.SpecialPrefix..'friends</i> - Runs command on anyone on your friends list';
'<i>%TEAMNAME</i> - Runs command on everyone in the team TEAMNAME Ex: '..Settings.Prefix..'kill %raiders';
'<i>$GROUPID</i> - Run a command on everyone in the group GROUPID, Will default to the GroupId setting if no id is given';
'Put <i>/e</i> in front to silence commands in chat (<i>/e '..Settings.Prefix..'kill scel</i>) or enable chat command hiding in client settings';
'Player commands can be used by anyone, these commands have <i>'..Settings.PlayerPrefix..'</i> infront, such as <i>'..Settings.PlayerPrefix..'info</i> and <i>'..Settings.PlayerPrefix..'rejoin</i>';
'';
'<b>――――― Player Selectors ―――――</b>';
'Usage example: <i>'..Settings.Prefix..'kill '..Settings.SpecialPrefix..'all</i> (where <i>'..Settings.SpecialPrefix..'all</i> is the selector)';
'<i>'..Settings.SpecialPrefix..'me</i> - Yourself';
'<i>'..Settings.SpecialPrefix..'all</i> - Everyone in the server';
'<i>'..Settings.SpecialPrefix..'admins</i> - Admin in the server';
'<i>'..Settings.SpecialPrefix..'nonadmins</i> - Non-admins (normal players) in the server';
'<i>'..Settings.SpecialPrefix..'others</i> - Everyone except yourself';
'<i>'..Settings.SpecialPrefix..'random</i> - A random person in the server';
'<i>#NUM</i> - NUM random players in the server <i>'..Settings.Prefix..'ff #5</i> will ff 5 random players.';
'<i>'..Settings.SpecialPrefix..'friends</i> - Your friends who are in the server';
'<i>%TEAMNAME</i> - Members of the team TEAMNAME Ex: '..Settings.Prefix..'kill %raiders';
'<i>$GROUPID</i> - Members of the group with ID GROUPID (number in the Roblox group webpage URL)';
'<i>-PLAYERNAME</i> - Will remove PLAYERNAME from list of players to run command on. '..Settings.Prefix..'kill all,-scel will kill everyone except scel';
'<i>#NUMBER</i> - Will run command on NUMBER of random players. <i>'..Settings.Prefix..'ff #5</i> will ff 5 random players.';
'<i>radius-NUMBER</i> -- Lets you run a command on anyone within a NUMBER stud radius of you. '..Settings.Prefix..'ff radius-5 will ff anyone within a 5 stud radius of you.';
'<i>radius-NUM</i> -- Anyone within a NUM-stud radius of you. '..Settings.Prefix..'ff radius-5 will ff anyone within a 5-stud radius of you.';
'';
'Certain commands can be used by anyone, these commands have <i>'..Settings.PlayerPrefix..'</i> infront, such as <i>'..Settings.PlayerPrefix..'clean</i> and <i>'..Settings.PlayerPrefix..'rejoin</i>';
'<i>'..Settings.Prefix..'kill me,noob1,noob2,'..Settings.SpecialPrefix..'random,%raiders,$123456,!nonadmins,-scel</i>';
'<b>――――― Repetition ―――――</b>';
'Multiple player selections - <i>'..Settings.Prefix..'kill me,noob1,noob2,'..Settings.SpecialPrefix..'random,%raiders,$123456,'..Settings.SpecialPrefix..'nonadmins,-scel</i>';
'Multiple Commands at a time - <i>'..Settings.Prefix..'ff me '..Settings.BatchKey..' '..Settings.Prefix..'sparkles me '..Settings.BatchKey..' '..Settings.Prefix..'rocket jim</i>';
'You can add a wait if you want; <i>'..Settings.Prefix..'ff me '..Settings.BatchKey..' !wait 10 '..Settings.BatchKey..' '..Settings.Prefix..'m hi we waited 10 seconds</i>';
'You can add a delay if you want; <i>'..Settings.Prefix..'ff me '..Settings.BatchKey..' !wait 10 '..Settings.BatchKey..' '..Settings.Prefix..'m hi we waited 10 seconds</i>';
'<i>'..Settings.Prefix..'repeat 10(how many times to run the cmd) 1(how long in between runs) '..Settings.Prefix..'respawn jim</i>';
'Place HeadAdmins can edit some settings in-game via the '..Settings.Prefix..'settings command';
'Please refer to the Tips and Tricks section under the settings in the script for more detailed explanations'
'';
'<b>――――― Reference Info ―――――</b>';
'<i>'..Settings.Prefix..'cmds</i> for a list of available commands';
'<i>'..Settings.Prefix..'cmdinfo &lt;command w/o prefix&gt;</i> for detailed info about a command';
'<i>'..Settings.PlayerPrefix..'brickcolors</i> for a list of BrickColors';
'<i>'..Settings.PlayerPrefix..'materials</i> for a list of materials';
'';
'<i>'..Settings.Prefix..'capes</i> for a list of preset admin capes';
'<i>'..Settings.Prefix..'musiclist</i> for a list of preset audios';
'<i>'..Settings.Prefix..'insertlist</i> for a list of insertable assets using '..Settings.Prefix..'insert';
}
Remote.MakeGui(plr,"List",{Title = 'Usage', Tab = usage, Size = {280, 240}, RichText = true})
Remote.MakeGui(plr,"List",{Title = 'Usage', Tab = usage, Size = {300, 250}, RichText = true})
end
};

Expand Down Expand Up @@ -580,7 +676,7 @@ return function(Vargs, env)
end
end
};]]

InspectAvatar = {
Prefix = Settings.PlayerPrefix;
Commands = {"inspectavatar";"avatarinspect";"viewavatar";"examineavatar";};
Expand Down Expand Up @@ -608,7 +704,7 @@ return function(Vargs, env)
Remote.LoadCode(plr,[[service.StarterGui:SetCore("DevConsoleVisible",true)]])
end
};

NumPlayers = {
Prefix = Settings.PlayerPrefix;
Commands = {"pnum","numplayers","playercount"};
Expand All @@ -633,7 +729,7 @@ return function(Vargs, env)
end
end
};

TimeDate = {
Prefix = Settings.Prefix;
Commands = {"timedate";"date";"datetime";};
Expand Down Expand Up @@ -681,3 +777,4 @@ return function(Vargs, env)

}
end