Permission or integer array inspect

  • 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.

Vxnku

Member
Nov 29, 2022
15
0
1
23
Hello
I want to make the script detect the number from the player's Permission config. From this code

Code:
            if player has permission "inventoryweight.maxweight.150":
                execute console command "/lp user %arg-1% permission unset inventoryweight.maxweight.150"
            if player has permission "inventoryweight.maxweight.200":
                execute console command "/lp user %arg-1% permission unset inventoryweight.maxweight.200"
            if player has permission "inventoryweight.maxweight.250":
                execute console command "/lp user %arg-1% permission unset inventoryweight.maxweight.250"
            if player has permission "inventoryweight.maxweight.300":
                execute console command "/lp user %arg-1% permission unset inventoryweight.maxweight.300"
            if player has permission "inventoryweight.maxweight.350":
                execute console command "/lp user %arg-1% permission unset inventoryweight.maxweight.350"
            if player has permission "inventoryweight.maxweight.400":
                execute console command "/lp user %arg-1% permission unset inventoryweight.maxweight.400"
            if player has permission "inventoryweight.maxweight.450":
                execute console command "/lp user %arg-1% permission unset inventoryweight.maxweight.450"
            if player has permission "inventoryweight.maxweight.500":
                execute console command "/lp user %arg-1% permission unset inventoryweight.maxweight.500"
            if player has permission "inventoryweight.maxweight.550":
                execute console command "/lp user %arg-1% permission unset inventoryweight.maxweight.550"
            if player has permission "inventoryweight.maxweight.600":
                execute console command "/lp user %arg-1% permission unset inventoryweight.maxweight.600"
            if player has permission "inventoryweight.maxweight.650":
                execute console command "/lp user %arg-1% permission unset inventoryweight.maxweight.650"
            if player has permission "inventoryweight.maxweight.700":
                execute console command "/lp user %arg-1% permission unset inventoryweight.maxweight.700"
            if player has permission "inventoryweight.maxweight.750":
                execute console command "/lp user %arg-1% permission unset inventoryweight.maxweight.750"
            if player has permission "inventoryweight.maxweight.800":
                execute console command "/lp user %arg-1% permission unset inventoryweight.maxweight.800"
            if player has permission "inventoryweight.maxweight.850":
                execute console command "/lp user %arg-1% permission unset inventoryweight.maxweight.850"
            if player has permission "inventoryweight.maxweight.900":
                execute console command "/lp user %arg-1% permission unset inventoryweight.maxweight.900"
            execute console command "/lp user %arg-1% permission set inventoryweight.maxweight.%{wl.%player%}%"


So I don't want to have to type 999 "if player has permission "inventoryweight.maxweight.{integer}"
 
Try this: Untested, of course.
Code:
loop 16 times:
  if player has permission "inventoryweight.maxweight.%100 + 50*loop-number%":
    execute console command "/lp user %arg-1% permission unset inventoryweight.maxweight.%100 + 50*loop-number%"
 
Status
Not open for further replies.