đź‘‹Â Welcome
Getting Started
Products
Support
<aside> ℹ️
In Beta! Get the Beta SDK here.
</aside>
SB Commands is similar to admin tools that help you drive engagement and monetize your experience. Let players earn or buy ranks that give them access to a variety of customizable commands.
SB Commands is built to be highly customizable:
Before you start:
Open your BloxbizConfig
in your Replicated Storage
Copy and paste the below code into BloxbizConfig
:
local BloxbizConfig = {}
BloxbizConfig.AccountID = Account ID
BloxbizConfig.SBCommandsEnabled = true
BloxbizConfig.SBCommandsShowToolbarButton = true -- Show the topbar button
BloxbizConfig.SBCommandsToolbarIcon = 97117264615637 -- Button image (Image ID)
BloxbizConfig.SBCommandsToolbarButtonLabel = "SB Commands" -- Button text
return BloxbizConfig
Replace where it says Account ID
with your Bloxbiz Account ID
Create a new ModuleScript in ReplicatedStorage and name it SBCommandsConfig
.
Copy and paste the below code
local Config = {}
Config.Prefix = ";" -- The command prefix to use infront of the command when typing in chat
Config.DefaultRank = {"default",} -- The starting rank(s) of a new player
Config.DisableDefaultCommands = false -- If true, the default commands will be removed
return Config
In SBCommandsConfig
you can customize ranks. Ranks can have a set of commands as well information for players on how to obtain that rank. Here are some examples:
local Config = {}
...
Config.Ranks = {
default = {
Name = "Default",
CommandPermissions = {
Commands = {"bighead", "smallhead", "superwalk", "loserwalk", "superjump", "loserjump",},
},
ObtainDescription = "This is how to obtain the Default rank.",
},
admin = {
Name = "Admin",
CommandPermissions = {
Commands = {"_all",}, -- "_all" grants access to all commands
},
ObtainDescription = "Purchase the Admin rank.",
ObtainButtonText = "Buy Rank",
ObtainButtonGamepass = 1000, -- Prompt players to purchase a gamepass. It will automatically handle giving them the rank.
},
moderator = {
Name = "Moderator",
CommandPermissions = {
InheritFrom = {"default",}, -- InheritFrom grants access to all commands for that rank
Commands = {"kill", "bring", "to", "-loserjump"},
},
ObtainDescription = "This is how to obtain the Moderator rank.",
ObtainButtonText = "Buy Rank",
ObtainButtonCallback = function(player)
local MarketplaceService = game:GetService("MarketplaceService")
MarketplaceService:PromptGamePassPurchase(player, 1000)
end,
},
headmoderator = {
Name = "Head Moderator",
CommandPermissions = {
InheritFrom = {"default", "moderator",},
Commands = {"frogify", "dinofy", "buffify", "fatify", "creepify",},
},
ObtainDescription = "This is how to obtain the Head Moderator rank.",
},
}
return Config
Commands
In CommandPermissions
you can assign commands to a rank:
Commands = {"command1", "command2",…}
- assign a list of commandsCommands = {"_all"}
- use _all
to give a rank access to all commandsInheritFrom = {”rankName”,…)
- assigns all commands from another rank(s)Obtain Setting
Use obtain settings to educate players on how to unlock a rank:
ObtainDescription = "Requires gamepass"
- include helpful information on how to unlock the rank (eg., “Requires gamepass”, “Complete level 2”, “Find the golden egg”)
ObtainButtonText = "Buy"
- this button will trigger the callback or gamepass. If no callback or gamepass is set, the button will be hidden.
ObtainButtonGamepass = 1000
– replace with your gamepass ID. If set, will prompt players to purchase the gamepass and automatically handles rewarding a player with the rank (still works even if the gamepass is purchases outside of the experience)
ObtainButtonCallback = ...
- trigger a function to obtain the rank (eg., prompt a gamepass, teleport a player somewhere)
-- gamepass example
ObtainButtonCallback = function(player)
local MarketplaceService = game:GetService("MarketplaceService")
MarketplaceService:PromptGamePassPurchase(player, gamepassId)
end
In SBCommandsConfig
you can customize commands. There are default commands you can use, disable, or override. You can also freely define your own commands. Here are some examples:
local Config = {}
...
Config.ModifyCommands = {
-- Disable a specific default command
smallhead = false,
-- Modify an existing default command
bighead = {
Name = "HugeHead",
Description = "Gives a player a huge head",
},
-- Add a new custom command
testcommand = {
Name = "TestCommand",
Description = "A test description",
Callback = function(player, args)
local targetPlayer = args[1]
print(player.Name .. " used the CustomCommand on player " .. targetPlayer.Name)
end,
},
}
return Config
You can create your own gameplay or interactions that interact with SB Commands. For example:
local ServerScriptService = game:GetService("ServerScriptService")
local BloxbizAPI = require(ServerScriptService:WaitForChild("BloxbizSDK").PublicAPI)
-- Returns all ranks for that player
local playerRanks = BloxbizAPI.GetRanks(player)
-- Returns boolean whether that player has the specified rank
local hasAdmin = BloxbizAPI.HasRank(player, "admin")
-- Gives that player the specified rank
BloxbizAPI.AddRank(player, "admin")
-- Clears all ranks for that player
BloxbizAPI.ClearRanks(player)
-- Removes the specified rank from that player
BloxbizAPI.RemoveRank(player, "admin")
You can customize how to open/close SB Commands using custom triggers.
local ServerScriptService = game:GetService("ServerScriptService")
local BloxbizAPI = require(ServerScriptService:WaitForChild("BloxbizSDK").PublicAPI)
-- Open SB Commands
BloxbizAPI.OpenSBCommands()
-- Close SB Commands
BloxbizAPI.CloseSBCommands()
-- Toggle SB Commands
BloxbizAPI.ToggleSBCommands()