Unlockable Buttons
A GUI button, that needs to be unlocked and can be toggled.
Last updated
Was this helpful?
A GUI button, that needs to be unlocked and can be toggled.
Last updated
Was this helpful?
Vault Addon (If requiring money to unlock)
First, you need to set up the "GUI stack". The first item should be the "activated" button, the second should be the "deactivated" button, and the third should be the "purchase" button.
For the "activated" and the "deactivated" button you will need to set a permission to view the item. For example button.unlocked
could be the perm for the deactivated button, and button.active
the perm for the active button.
First we need to check if they have what is needed to unlock the button.
Start by checking the players balance to see if they have the 10 coins (dollars) required.
If they do, take the money from them, if they don't, send a message saying they don't have enough money.
Next, you will want to get the name of the player who clicke don the button.
Now we will give the player the permission needed to view the deactivated button (button.unlocked
). You need to use the the command associated with the permission plugin you use. For uperms its upc addPlayerPermission %1 button.unlocked
First we need to get the player name of the player who clicked the button.
Then you just have to add the permission button.active
to the user.
After this, you add any elements you need to activate the perk, skill, or thing that is associated with this button. For example you could execute the command needed to put the player into vanish.
Once again we need to get the name of the player who clicked the button.
Then we will remove the permission button.active
using your permission plugins command. For uperms the command is upc removePlayerPermission %1 button.active
Now you use whatever elements you need to deactivate the perk, skill, or thing associated with the button. For example taking a player out of vanish.