I need help with my STAFF skript!

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

KitDK

New Member
Apr 13, 2017
7
1
0
20
Hi Everybody thanks for clicking on this skript i just need help with my skript.
I'm a noob skripter so i guess this is preety easy for your guys.

I wanted to make a STAFF mode skript but the problem is the Teleport menu and The Inventory thing.

And the teleport menu won't open here is my code:

code_language.skript:
on load:
    send "&7| &3OK &7| &a&lSTAFF MODE SUCCESSFULLY LOADED!" to console
   


on rightclick:
    if player is holding a clock named "&9&lTELEPORT":
        make player execute command "/dwkdwkkwkdw"
    if player is holding a book named "&c&lTJEK INVENTORY":
        if clicked player isn't op:
            open clicked player's inventory
        else:
            message "&7|| &4&lSTAFF &7|| &cDu kan ikke tjekke en OP's INVENTORY! &7(Dette er blevet reporteret)"
            loop all players:
                loop-player is op:
                    message "&7|| &4&lSTAFF &7|| &cDer var en staff der prøvede at åbne din inv." to loop-player
    if player is holding a wooden axe named "&2&lWORLDEDIT":
        if player isn't op:
            if player doesn't have permission "worledit.*":
                message "&7|| &4&lSTAFF &7|| &2Du har ikke adgang til at bruge &a&lWORLDEDIT"
    if player is holding a leather named "&b&lREGIONS":
        if player isn't op:
            if player doesn't have permission "worledit.*":
                message "&7|| &4&lSTAFF &7|| &2Du har ikke adgang til at se &b&lREGIONS"
           
       
           
command /staff:
    permission: staff.use
    permission message: &7|| &4&lSTAFF &7||&cDu har ikke adgang til denne komando!
    trigger:
        if {staffmode.%player%} is not set:
            loop all items in player's inventory:
                add loop-item to {inventory::%player%::*}
            set {staffmode.%player%} to true
            set player's gamemode to creative
            set slot 0 of player's inventory to compass named "&e&lTHRU" with lore "&aKom igennem mure."
            set slot 1 of player's inventory to clock named "&9&lTELEPORT" with lore "&aTeleport til en spiller."
            set slot 2 of player's inventory to wooden axe named "&2&lWORLDEDIT" with lore "&aLav worldedit."
            set slot 3 of player's inventory to leather named "&b&lREGIONS" with lore "&aTjek Regions."
            set slot 4 of player's inventory to book named "&c&lTJEK INVENTORY" with lore "&aTjek en spillers inv."
            message "&7|| &4&lSTAFF &7|| &aDu er nu inde i Staff mode!"
        else:
            delete {staffmode.%player%}
            set player's gamemode to survival
            clear player's inventory
            message "&7|| &4&lSTAFF &7|| &cDu er nu ude af Staff mode!"
            wait 0.5 tick
            loop {inventory::%player%::*}:
                add loop-value to the player's inventory

command /dwkdwkkwkdw:
    permission: staff.use
    trigger:
        open chest with 3 rows named "&9&lTELEPORT SPILLER" to player
        wait 1 tick
        set {_k} to 0
        wait 1 tick
        loop all players:
            loop-player isn't op:
                format slot {_k} of player with skull of loop-player named "&7%loop-player%" with lore "&cHelath: &a%loop-player's health%||&cBalance: &a%loop-player's balance%||&cRank: %colored loop-player's prefix%" to close then run [make player execute command "/etpo %loop-player%" ]
                add 1 to {_k}

(I'm from Denmark english isn't my first language And the skript messages is wrote in Danish)
 
Last edited:
I see the problem and I fix it and test it the problem is the lore look here is a new code with no lore


code_language.skript:
on load:
    send "&7| &3OK &7| &a&lSTAFF MODE SUCCESSFULLY LOADED!" to console
  
 
 
on rightclick:
    if held item of the player is a clock named "&9&lTELEPORT":
        make player execute command "/dwkdwkkwkdw"
    if player is holding a book named "&c&lTJEK INVENTORY":
        if clicked player isn't op:
            open clicked player's inventory
        else:
            message "&7|| &4&lSTAFF &7|| &cDu kan ikke tjekke en OP's INVENTORY! &7(Dette er blevet reporteret)"
            loop all players:
                loop-player is op:
                    message "&7|| &4&lSTAFF &7|| &cDer var en staff der prøvede at åbne din inv." to loop-player
    if player is holding a wooden axe named "&2&lWORLDEDIT":
        if player isn't op:
            if player doesn't have permission "worledit.*":
                message "&7|| &4&lSTAFF &7|| &2Du har ikke adgang til at bruge &a&lWORLDEDIT"
    if player is holding a leather named "&b&lREGIONS":
        if player isn't op:
            if player doesn't have permission "worledit.*":
                message "&7|| &4&lSTAFF &7|| &2Du har ikke adgang til at se &b&lREGIONS"
          
      
          
command /staff:
    permission: staff.use
    permission message: &7|| &4&lSTAFF &7||&cDu har ikke adgang til denne komando!
    trigger:
        if {staffmode.%player%} is not set:
            loop all items in player's inventory:
                add loop-item to {inventory::%player%::*}
            set {staffmode.%player%} to true
            set player's gamemode to creative
            set slot 0 of player's inventory to compass named "&e&lTHRU"
            set slot 1 of player's inventory to clock named "&9&lTELEPORT"
            set slot 2 of player's inventory to wooden axe named "&2&lWORLDEDIT"
            set slot 3 of player's inventory to leather named "&b&lREGIONS"
            set slot 4 of player's inventory to book named "&c&lTJEK INVENTORY"
            message "&7|| &4&lSTAFF &7|| &aDu er nu inde i Staff mode!"
        else:
            delete {staffmode.%player%}
            set player's gamemode to survival
            clear player's inventory
            message "&7|| &4&lSTAFF &7|| &cDu er nu ude af Staff mode!"
            wait 0.5 tick
            loop {inventory::%player%::*}:
                add loop-value to the player's inventory
 
command /dwkdwkkwkdw:
    permission: staff.use
    trigger:
        open chest with 3 rows named "&9&lTELEPORT SPILLER" to player
        wait 1 tick
        set {_k} to 0
        wait 1 tick
        loop all players:
            loop-player isn't op:
                format slot {_k} of player with skull of loop-player named "&7%loop-player%" with lore "&cHelath: &a%loop-player's health%||&cBalance: &a%loop-player's balance%||&cRank: %colored loop-player's prefix%" to close then run [make player execute command "/etpo %loop-player%" ]
                add 1 to {_k}
 
This fix should fix this error in the command `/dwk...`
code_language.skript:
command /dwkdwkkwkdw:
    permission: staff.use
    trigger:
        open chest with 3 rows named "&9&lTELEPORT SPILLER" to player
        wait 1 tick
        set {_k} to 0
        wait 1 tick
        loop all players:
            loop-player isn't op:
                format slot ({_k}) of player with skull of "%loop-player%" parsed as offline player named "&7%loop-player%" with lore "&cHelath: &a%loop-player's health%||&cBalance: &a%loop-player's balance%||&cRank: %colored loop-player's prefix%" to close then run [make player execute command "/etpo %loop-player%"]
                add 1 to {_k}

I'd also like to point out a possible issue with this command, Teleporting to the player may end up teleporting you to the last person in the GUI, and if you do not want this error; I would recommend using TuSKe instead of skQuery's Inventory management.
 
Try: wait 2 ticks before open menu
code_language.skript:
command /dwkdwkkwkdw:
    permission: staff.use
    trigger:
        wait 2 ticks
        open chest with 3 rows named "&9&lTELEPORT SPILLER" to player
        wait 1 tick
        set {_k} to 0
        wait 1 tick
        loop all players:
            loop-player isn't op:
                format slot {_k} of player with skull of loop-player named "&7%loop-player%" with lore "&cHelath: &a%loop-player's health%||&cBalance: &a%loop-player's balance%||&cRank: %colored loop-player's prefix%" to close then run [make player execute command "/etpo %loop-player%" ]
                add 1 to {_k}
 
Status
Not open for further replies.