This Rust plugin turns electric buttons into command triggers, allowing you to execute commands when pressed.
Permissions
buttoncommands.admin- Grant this to admins who should manage buttons in-game.
Commands
bc.add- Registers the button you're currently looking at.bc.remove- Unregisters the button you're looking at and deletes its stored settings.bc.list [page]- Lists all registered buttons in pages.page- (Optional) The page number to view (default is 1).
bc.show- Displays all settings and assigned commands for the button you're looking at.bc.set <field> <value>- Changes one setting on the button you're looking at.field- One of:requirepower,disableoutput,runrandom,cooldown.value- Useon/offfor toggles, or a number for cooldown (in seconds).
bc.addcmd <type> <command>- Adds a new command to the button you're looking at.type- One of:Chat,Server, orClient.command- The command text to run.
bc.delcmd <index>- Removes a command from the button by its index.index- The number shown inbc.show(starting from 1).
bc.clearcmds- Deletes all commands from the button you're looking at.bc.help- Displays a full list of all available admin commands.
Stored Data
JSON:
{
"Press Buttons": {
"123456789": {
"Require Button Powered": true,
"Disable Power Output On Press": true,
"Run Random Command": false,
"Cooldown Seconds": 60.0,
"Commands": [
{
"Type": "Chat",
"Command": "Hello, {PlayerName}!"
},
{
"Type": "Server",
"Command": "inventory.giveto {PlayerId} scrap 50"
},
{
"Type": "Client",
"Command": "heli.calltome"
}
]
}
}
}
Press Buttons- A list of all registered buttons, each one stored by its net id (this is automatic, you don't need to manage these ids yourself).Require Button Powered- If set to true, the button only works when it has power (like electricity from a wire or battery).Disable Power Output On Press- If set to true, the button won't send out electricity when pressed, useful if you only want it to run commands without powering anything.Run Random Command- If set to true, only one random command from the list will run when the button is pressed. If false, all commands will run.Cooldown Seconds- How many seconds a player must wait before pressing the same button again.Commands- The list of commands that will run when the button is pressed.Type- Tells the plugin how to run the command:Server(runs in console),Client(runs on the player's game), orChat(as if the player typed it in chat).Command- The actual command that runs. You can use special placeholders like{PlayerId},{PlayerName}, or{Grid}to insert info about the player who pressed the button.
Localization
JSON:
{
"Error.NoPermission": "You do not have permission to use this command.",
"Error.AlreadyRegistered": "This button already has commands assigned.",
"Error.NotRegistered": "This button hasn’t been registered yet. Use 'bc.add' to register it.",
"Error.NoButtonInSight": "You must be looking directly at a button to register it.",
"Error.NoButtonInRange": "You are too far away from the button to register it.",
"Error.CooldownActive": "You must wait {0} before using this button again.",
"Error.InvalidBool": "Invalid boolean value for '{0}'. Use true/false, on/off, or 1/0.",
"Error.InvalidNumber": "Invalid number entered for '{0}'. Please enter a valid positive number.",
"Error.InvalidCommandType": "Unknown command type. Use Chat, Server, or Client.",
"Error.InvalidIndex": "Invalid index. Please enter a valid number matching the command list.",
"Error.UnknownField": "Unknown field '{0}'. Supported fields: requirepower, disableoutput, runrandom, cooldown.",
"Error.MissingArgs.Set": "Missing arguments. Usage: bc.set <requirepower|disableoutput|runrandom|cooldown> <value>",
"Error.MissingArgs.AddCmd": "Missing arguments. Usage: bc.addcmd <Chat|Server|Client> <command text...>",
"Error.MissingArgs.DelCmd": "Missing argument. Usage: bc.delcmd <index> (use 'bc.show' to see indexes)",
"Error.NoButtonsDefined": "There are no buttons currently registered.",
"Info.ButtonRegistered": "Button registered successfully. It will now run the assigned commands.",
"Info.Removed": "Button has been unregistered and its data removed.",
"Info.SetBool": "{0} has been set to {1}.",
"Info.SetCooldown": "Cooldown updated to {0} seconds.",
"Info.AddedCommand": "Command #{0} added: {1} {2}",
"Info.RemovedCommand": "Command #{0} removed from the button.",
"Info.ClearedCommands": "All {0} commands cleared from this button.",
"Info.ListHeader": "Showing {0} registered buttons (Page {1} of {2}):",
"Info.ListEntry": "• ID {0} ({1}) | PowerRequired={2}, DisableOutput={3}, RunMode={4}, Cooldown={5}s, Commands={6}",
"Info.ShowHeader": "Button Settings — PowerRequired={0}, DisableOutput={1}, RunMode={2}, Cooldown={3}s, Commands={4}",
"Info.ShowCommandEntry": "#{0}: {1} \"{2}\"",
"Info.Help.Header": "Admin Button Commands — Usage and Descriptions",
"Info.Help.Line": "• {0} — {1}",
"Info.Help.Add.Usage": "bc.add",
"Info.Help.Add.Desc": "Register the button you're currently looking at.",
"Info.Help.Remove.Usage": "bc.remove",
"Info.Help.Remove.Desc": "Unregister the button you’re looking at and delete its settings.",
"Info.Help.List.Usage": "bc.list [page]",
"Info.Help.List.Desc": "List all registered buttons with their current settings.",
"Info.Help.Show.Usage": "bc.show",
"Info.Help.Show.Desc": "Show settings and commands for the button you're looking at.",
"Info.Help.Set.Usage": "bc.set <requirepower|disableoutput|runrandom|cooldown> <value>",
"Info.Help.Set.Desc": "Change a specific setting on the looked-at button.",
"Info.Help.AddCmd.Usage": "bc.addcmd <Chat|Server|Client> <command text...>",
"Info.Help.AddCmd.Desc": "Add a new command to run when the button is pressed.",
"Info.Help.DelCmd.Usage": "bc.delcmd <index>",
"Info.Help.DelCmd.Desc": "Remove a specific command from the button by its list index.",
"Info.Help.ClearCmds.Usage": "bc.clearcmds",
"Info.Help.ClearCmds.Desc": "Remove all commands assigned to the button."
}

