1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Variable permission (message) in commands

Discussion in 'Skript' started by mel_instagibson, Feb 13, 2018.

Thread Status:
Not open for further replies.
  1. mel_instagibson

    Joined:
    Feb 4, 2017
    Messages:
    71
    Likes Received:
    4
    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 (Skript):
    1. command /kit <string>:
    2.         permission: mel.kit.%arg-1%
    3.         permission message: &cYou don't have permission to use kit %arg-1%
    4.         trigger:
    5.                 if player has space for {kit::%arg-1%::*}:
    6.                         give {kit::%arg-1%::*} to player
    7.                 else:
    8.                         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
     
  2. Donut

    Donut Well-Known Member

    Joined:
    Mar 27, 2017
    Messages:
    1,340
    Likes Received:
    176
    Medals:
    just check the permission yourself
    Code (Skript):
    1. if player has permission "mel.kit.%arg-1%":
    2.     #do stuff
    3. else:
    4.     send "&cYou don't have permission to use kit %arg-1%"
     
    • Like Like x 1
  3. mel_instagibson

    Joined:
    Feb 4, 2017
    Messages:
    71
    Likes Received:
    4
    yea im aware of that but i thought ther might be a "cleaner" way to do it
     
  4. Snow-Pyon

    Moderator Resource Staff

    Joined:
    Jan 25, 2017
    Messages:
    1,236
    Likes Received:
    176
    Medals:
    You can't do this currently, it'll be soon possible though, maybe for the next Skript version.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...