$toggleRoles

Toggles roles on a user. This means it removes specified roles if the user already has them, and adds them if they don't.

Usage:

$toggleRoles[userID;roleID 1;roleID 2;roleID 3;...]

  • userID: The ID of the user to toggle the roles on.
  • roleID 1;roleID 2;roleID 3;...: A list of role IDs to toggle, separated by semicolons.

Member07/28/2026
!!exec $toggleRoles[$authorID;$roleID[Member +]]

Example:

This example toggles the "Member +" role on the command executor. If the user has the role it will be removed, if they don't have it, it will be added.

Used Functions

$roleID, to get the ID of a role by name. This is used to dynamically find the role ID based on its name.

Related Functions

  • $giveRoles: Gives roles to a user.
  • $takeRoles: Removes roles from a user.
  • $setRoles: Removes all existing roles from a user and then adds the specified roles.
Function difficulty: Medium

⏱️ Function Cooldown

This function has a built-in cooldown to help prevent excessive usage.

PropertyValue
⏱️ Duration6 seconds
🆔 Tracked ByUser ID
🌐 ScopeUserupdate

Functions with the same Scope share cooldowns based on the same Tracked By value.

💎 Tier 3+ servers bypass this cooldown. See Premium Perksopen in new window.