Tutorial: (Method) Global Cooldown - ssomar1607/ExecutableItems GitHub Wiki

Tutorial to how to make a Global Cooldown on an activator

REQUIREMENTS

  • Placeholder API
    • ParseOther Expansion
    • Luckperms Expansion
  • Luckperms
  • ExecutableItems

Nutshell of this method

  • Basically, you're having all players check if that specific player has the temporary perm on or not

1) Plan what player you're going to assign the permission

  • How this method basically works is that it will check if a specific player has that specific permission or not. Why am I asking what player do we need to assign the permission? Because we will be checking a player's permission so when one person triggered the activator, no player can use the activator again until the cooldown is over.

Oversimplified Explanation:

  • There's only one type of button and anyone can press it. If someone presses it, it disappears and reappears after a period of time. When the button reappears, anyone can press the button and repeat.

Notes:

  • The player you are going to be using for the condition has to be a player who logged into your server at least once or else running the luckperms command won't work

2) Create the activator

  • Create the activator that you want to use and assign the global cooldown

3) Create a placeholder condition

    • Go to the conditions editor
    • Select placeholder conditions
    • Create a new placeholder
    • Select the PLAYER_STRING type
    • Read the information below

Information about the placeholder condition

  • In the first part, you have to create a placeholder like this. %parseother_{name of the player you will be assigning}_{luckperms_has_permission_cs.go}%
  • In-depth Explanation: The ParseOther placeholder will compare this {luckperms_has_permission_cs.go} placeholder to the player you will be assigning. For example, you decided to use your main account as the placeholder the condition's going to listen at so the placeholder will look like this: %parseother_{Special70}_{luckperms_has_permission_cs.go}
    • For the luckperms placeholder, I recommend using a random permission that does nothing to prevent giving yourself possible unnecessary problems due to them being related to an existing plugin. Not using cs.go permission will not break the method. This is just an example.
    • The reason why the 2nd part has to be no because if the player has the permission and when you try to parse it, it says yes. We want the placeholder to print out the answer of no because it means that no one has yet to trigger the activator so the permission has yet to be given

4) Setting the command

  • Add this command:
lp user (name of the player you will be assigning) permission settemp (permission) true (duration) replace
  • So for example, you decided that
    • The name of the player you will be assigning:
      • Special70
    • The permission in the luckperms placeholder
      • cs.go
    • The duration of how long the global cooldown will be
      • 2d
  • So this will be the command you will be adding on the commands section
lp user Special70 permission settemp cs.go true 2d replace

If the guide wasn't clear enough or there was a mistake, please contact me (Special70#7668) in discord.