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!


    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.

Solved Permissions doesnt get Saved

Discussion in 'Skript' started by ClaasCode, Apr 4, 2021.

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

    ClaasCode Member

    Apr 4, 2021
    Likes Received:
    Im trying to use SkQuery's Permission System.
    If i execute
    /rank CloudF0rce Premium
    it works how (like i cant execute that command again) but after i rejoin i can enter that command again (so i have Admin Perms again)

    Note: I do have OP tho

    My Code:
    Code (Text):
    1. Options:
    2.     P: &7× &9CloudMC &7×
    3.     Owner: "CloudF0rce"
    4.     Invalid: "&7× &9CloudMC &7× &cInvalid Command"
    5.     Admin: "cm.Admin"
    6.     Mod: "cm.Mod"
    7.     Prem: "cm.Premium"
    8.     Player: "cm.Player"
    9.     NoPerm: "&7× &9CloudMC &7× &cNo Permissions"
    11. script options:
    12.     $ use permissions
    14. command /rank [<offlineplayer>] [<text>]:
    15.     trigger:
    16.         if player has permission {@Admin}:
    17.             if arg 1 and arg 2 is set:
    18.                 if arg-2 is "Admin":
    19.                     if arg-1 has permission {@Mod}:
    20.                         remove {@Mod} from arg-1's permissions
    21.                     if arg-1 has permission {@Prem}:
    22.                         remove {@Prem} from arg-1's permissions
    23.                     if arg-1 has permission {@Player}:
    24.                         remove {@Player} from arg-1's permissions
    25.                     add {@Admin} to arg-1's permissions
    26.                     broadcast "{@P} The Player &a%arg-1%&7 is now &cAdmin"
    27.                 if arg-2 is "Mod" or "Moderator":
    28.                     if arg-1 has permission {@Admin}:
    29.                         remove {@Admin} from arg-1's permissions
    30.                     if arg-1 has permission {@Prem}:
    31.                         remove {@Prem} from arg-1's permissions
    32.                     if arg-1 has permission {@Player}:
    33.                         remove {@Player} from arg-1's permissions
    34.                     add {@Mod} to arg-1's permissions
    35.                     broadcast "{@P} The Player &a%arg-1%&7 is now &bMod"
    36.                 if arg-2 is "Premium" or "Prem":
    37.                     if arg-1 has permission {@Mod}:
    38.                         remove {@Mod} from arg-1's permissions
    39.                     if arg-1 has permission {@Admin}:
    40.                         remove {@Admin} from arg-1's permissions
    41.                     if arg-1 has permission {@Player}:
    42.                         remove {@Player} from arg-1's permissions
    43.                     add {@Admin} to arg-1's permissions
    44.                     broadcast "{@P} The Player &a%arg-1%&7 is now &ePremium"
    45.                 if arg-2 is "Player":
    46.                     if arg-1 has permission {@Mod}:
    47.                         remove {@Mod} from arg-1's permissions
    48.                     if arg-1 has permission {@Admin}:
    49.                         remove {@Admin} from arg-1's permissions
    50.                     if arg-1 has permission {@Prem}:
    51.                         remove {@Prem} from arg-1's permissions
    52.                     add {@Player} to arg-1's permissions
    53.                     broadcast "{@P} The Player &a%arg-1%&7 is now &ePremium"
    54.         else:
    55.             send {@NoPerm}
    57. on join:
    58.     set join message to "{@P} &7%player% joined"
    59.     heal the player
    60.     set hunger bar of player to 20
    61.     clear player's inventory
    62.     teleport player to {Spawn}
    63.     if player has permission {@Player}:
    64.         set player tab name to "&7Player ┃ %player%"
    65.     if player has permission {@Prem}:
    66.         set player tab name to "&ePremium &7┃ %player%"
    67.     if player has permission {@Mod}:
    68.         set player tab name to "&bMod &7┃ %player%"
    69.     if player has permission {@Admin}:
    70.         set player tab name to "&cAdmin &7┃ %player%"
    IDK if this could help, but sometimes i get this error
    Code (Text):
    3. [19:58:51 ERROR]: Could not pass event PlayerQuitEvent to SkQuery v3.21.4
    4. org.bukkit.event.EventException
    5.         at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302) ~[patched.jar:git-PaperSpigot-"4c7641d"]
    6.         at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:78) ~[patched.jar:git-PaperSpigot-"4c7641d"]
    7.         at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[patched.jar:git-PaperSpigot-"4c7641d"]
    8.         at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:517) [patched.jar:git-PaperSpigot-"4c7641d"]
    9.         at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:502) [patched.jar:git-PaperSpigot-"4c7641d"]
    10.         at net.minecraft.server.v1_8_R3.PlayerList.disconnect(PlayerList.java:364) [patched.jar:git-PaperSpigot-"4c7641d"]
    11.         at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:875) [patched.jar:git-PaperSpigot-"4c7641d"]
    12.         at net.minecraft.server.v1_8_R3.PlayerConnection.disconnect(PlayerConnection.java:186) [patched.jar:git-PaperSpigot-"4c7641d"]
    13.         at net.minecraft.server.v1_8_R3.CommandKick.execute(SourceFile:50) [patched.jar:git-PaperSpigot-"4c7641d"]
    14.         at org.bukkit.craftbukkit.v1_8_R3.command.VanillaCommandWrapper.dispatchVanillaCommand(VanillaCommandWrapper.java:123) [patched.jar:git-PaperSpigot-"4c7641d"]
    15.         at org.bukkit.craftbukkit.v1_8_R3.command.VanillaCommandWrapper.execute(VanillaCommandWrapper.java:44) [patched.jar:git-PaperSpigot-"4c7641d"]
    16.         at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:146) [patched.jar:git-PaperSpigot-"4c7641d"]
    17.         at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchCommand(CraftServer.java:666) [patched.jar:git-PaperSpigot-"4c7641d"]
    18.         at net.minecraft.server.v1_8_R3.PlayerConnection.handleCommand(PlayerConnection.java:1189) [patched.jar:git-PaperSpigot-"4c7641d"]
    19.         at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:1001) [patched.jar:git-PaperSpigot-"4c7641d"]
    20.         at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(PacketPlayInChat.java:45) [patched.jar:git-PaperSpigot-"4c7641d"]
    21.         at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(PacketPlayInChat.java:1) [patched.jar:git-PaperSpigot-"4c7641d"]
    22.         at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13) [patched.jar:git-PaperSpigot-"4c7641d"]
    23.         at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_281]
    24.         at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_281]
    25.         at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44) [patched.jar:git-PaperSpigot-"4c7641d"]
    26.         at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:774) [patched.jar:git-PaperSpigot-"4c7641d"]
    27.         at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:378) [patched.jar:git-PaperSpigot-"4c7641d"]
    28.         at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:713) [patched.jar:git-PaperSpigot-"4c7641d"]
    29.         at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:616) [patched.jar:git-PaperSpigot-"4c7641d"]
    30.         at java.lang.Thread.run(Unknown Source) [?:1.8.0_281]
    31. Caused by: java.lang.IllegalArgumentException: Attachment cannot be null
    32.         at org.bukkit.permissions.PermissibleBase.removeAttachment(PermissibleBase.java:131) ~[patched.jar:git-PaperSpigot-"4c7641d"]
    33.         at org.bukkit.craftbukkit.v1_8_R3.entity.CraftHumanEntity.removeAttachment(CraftHumanEntity.java:126) ~[patched.jar:git-PaperSpigot-"4c7641d"]
    34.         at com.w00tmast3r.skquery.skript.PermissionsHandler.onQuit(PermissionsHandler.java:44) ~[?:?]
    35.         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_281]
    36.         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_281]
    37.         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_281]
    38.         at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_281]
    39.         at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:300) ~[patched.jar:git-PaperSpigot-"4c7641d"]
    40.         ... 25 more
    #1 ClaasCode, Apr 4, 2021
    Last edited: Apr 4, 2021
Thread Status:
Not open for further replies.

Share This Page