Variable permission (message) in commands

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.
Feb 4, 2017
71
4
1
36
I'm trying to use permissions based on a stirng in a command to check if a player can use kits, but at the moment it uses %arg-1% instead of the actual string, is there any clean way around this working with the command syntax itself?

code_language.skript:
command /kit <string>:
        permission: mel.kit.%arg-1%
        permission message: &cYou don't have permission to use kit %arg-1%
        trigger:
                if player has space for {kit::%arg-1%::*}:
                        give {kit::%arg-1%::*} to player
                else:
                        send "Not enough inventory space"

This gives the message "You don't have permission to use kit %arg-1%" and the permission isnt recognized either so neither the check nor the message is working
 
just check the permission yourself
code_language.skript:
if player has permission "mel.kit.%arg-1%":
    #do stuff
else:
    send "&cYou don't have permission to use kit %arg-1%"
 
  • Like
Reactions: mel_instagibson
Status
Not open for further replies.