Solved Help me!

  • 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.
How to create a Permission with Skript? Without PermissionsEx/LuckPerms?
I never did something like this, but try:
code_language.skript:
#add permission.
command /addperm [<offline player>] [<string>]:
    permission: addperm.use
    trigger:
        arg 1 and arg 2 are set:
            add arg 2 to {permissions::%arg 1%::*}
            send "&aDone!"

#Test.
command /test:
    trigger:
        if {permissions::%player%::*} contains "test.use":
            send "&aYou can use this command." to player
        else:
            send "&cYou cannot use this command." to player
 
I never did something like this, but try:
code_language.skript:
#add permission.
command /addperm [<offline player>] [<string>]:
    permission: addperm.use
    trigger:
        arg 1 and arg 2 are set:
            add arg 2 to {permissions::%arg 1%::*}
            send "&aDone!"

#Test.
command /test:
    trigger:
        if {permissions::%player%::*} contains "test.use":
            send "&aYou can use this command." to player
        else:
            send "&cYou cannot use this command." to player


Mh after I try it !! Can I also use "if player has permission" test.skript "?
 
ok, it works! Mhh, I can't run the /test command even if I'm OP, how to fix it? (without adding permission)
With this:
code_language.skript:
command /test:
    trigger:
        if player is op:
            send "&aYou can use this command as a op." to player
        else if {permissions::%player%::*} contains "test.use":
            send "&aYou can use this command with permission." to player
        else:
            send "&cYou cannot use this command." to player
 
With this:
code_language.skript:
command /test:
    trigger:
        if player is op:
            send "&aYou can use this command as a op." to player
        else if {permissions::%player%::*} contains "test.use":
            send "&aYou can use this command with permission." to player
        else:
            send "&cYou cannot use this command." to player

Ok, thanks! +1
 
Status
Not open for further replies.