Need help

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

TheGamer

Member
May 30, 2020
2
0
1
25
My code:

Code:
command /punish <player>:
    permission: punish
    trigger:
        if "%arg-1%" is set:
            open chest inventory with 5 rows named "&3Punish" to player

            set {_menu} to current inventory of player
            set {punish.player} to "%arg-1%"

            set slot 13 of {_menu} to ("%arg-1%" parsed as offline player)'s skull named "&3%arg-1%"

            set slot 19 of {_menu} to red wool named "&3reason for fly, xray, automine" with lore "30 day ban"

on inventory click:
    if name of event-inventory = "&3Punish":
        if event-item is red wool:
            if name of event-item is "&3reason for fly, xray, automine":
                execute console command "/tempban %{punish.player}% 30d &3fly, xray, automine"
        else:
            cancel eventcommand /punish <player>:
    permission: punish
    trigger:
        if "%arg-1%" is set:
            open chest inventory with 5 rows named "&3Punish" to player

            set {_menu} to current inventory of player
            set {punish.player} to "%arg-1%"

            set slot 13 of {_menu} to ("%arg-1%" parsed as offline player)'s skull named "&3%arg-1%"

            set slot 19 of {_menu} to red wool named "&3reason for fly, xray, automine" with lore "30 day ban"

on inventory click:
    if name of event-inventory = "&3Punish":
        if event-item is red wool:
            if name of event-item is "&3reason for fly, xray, automine":
                execute console command "/tempban %{punish.player}% 30d &3fly, xray, automine"
        else:
            cancel event

running custom skript by minehut i need help its not working even tho it should
 
My code:

Code:
command /punish <player>:
    permission: punish
    trigger:
        if "%arg-1%" is set:
            open chest inventory with 5 rows named "&3Punish" to player

            set {_menu} to current inventory of player
            set {punish.player} to "%arg-1%"

            set slot 13 of {_menu} to ("%arg-1%" parsed as offline player)'s skull named "&3%arg-1%"

            set slot 19 of {_menu} to red wool named "&3reason for fly, xray, automine" with lore "30 day ban"

on inventory click:
    if name of event-inventory = "&3Punish":
        if event-item is red wool:
            if name of event-item is "&3reason for fly, xray, automine":
                execute console command "/tempban %{punish.player}% 30d &3fly, xray, automine"
        else:
            cancel eventcommand /punish <player>:
    permission: punish
    trigger:
        if "%arg-1%" is set:
            open chest inventory with 5 rows named "&3Punish" to player

            set {_menu} to current inventory of player
            set {punish.player} to "%arg-1%"

            set slot 13 of {_menu} to ("%arg-1%" parsed as offline player)'s skull named "&3%arg-1%"

            set slot 19 of {_menu} to red wool named "&3reason for fly, xray, automine" with lore "30 day ban"

on inventory click:
    if name of event-inventory = "&3Punish":
        if event-item is red wool:
            if name of event-item is "&3reason for fly, xray, automine":
                execute console command "/tempban %{punish.player}% 30d &3fly, xray, automine"
        else:
            cancel event

running custom skript by minehut i need help its not working even tho it should
You cant use 'trigger' and put 'permission' syntax as you would when creating a command. Try something like this:
code_language.skript:
command /punish <player>:
    permission: punish
    trigger:
        arg 1 is set:
            open chest inventory with 5 rows named "&3Punish" to player

            set {_menu} to player's current inventory
            set {punish.player} to "%arg 1%"

            set slot 13 of {_menu} to arg 1's skull named "&3%arg-1%"

            set slot 19 of {_menu} to red wool named "&3reason for fly, xray, automine" with lore "30 day ban"

on inventory click:
    inventory name of player's current inventory is "&3Punish":
        event-slot = air:
            close player's inventory
        event-slot != air:    
           clicked slot is 19:
                wait a tick
               execute console command "/tempban %{punish.player}% 30d &3fly, xray, automine"
[doublepost=1590823366,1590823332][/doublepost]Also, you had unnecessary code.
 
There is also no need for "if arg-1 is set" if you're using "<>" in the command.
I would suggest you using:
Code:
command /punish [<player>]:
    #permission, aliases, ...
    trigger:
        if arg-1 is set:
            #your code
        else:
            send "You did not specify the player!"
 
Last edited:
Status
Not open for further replies.