Solved GUI ban skript not running commands

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

commandmaker

New Member
May 27, 2019
7
0
1
19
i've been making a gui ban skript or my server for a few hours and i can't get it to run commands anymore
it worked fine before but it just stopped working for some reason
i am using skript 1.14
thanks for any help
here is the skript

Code:
command /punish <offline player>:
    permission: sc.punish
    trigger:
        if {PunishPlayer::%player%} has the permission "sc.punish.exempt":
            message "&cYou Can Not Punish This Player"
        else:
            message "punish command ran"
            create new gui with virtual chest with 1 row named "&a&lPunishments":
                make gui slot 0 with diamond named "&cX-Ray" with lore "":
                    XrayPunish(player)
                make gui slot 1 with feather named "&cFly Hacks" with lore "":
                    FlyPunish(player)
            open last gui to player

command /resetoffence <offline player>:
    trigger:
        if player has the permission "sc.admin":
            delete {PunishOffences::%arg%}
            message "Reset Offences Of %arg%"
        else:
            message "&cYou Do Not Have This Permission"
            
function XrayPunish(p: player):
    message "%{_p}%" to {_p}
    create new gui with virtual chest with 1 row named "&a&lX-Ray Hacks":
        make gui slot 0 with barrier named "&61st Offence" with lore "":
            add 1 to {PunishOffences::%{PunishPlayer::%{_p}%}%}
            set {PunishTime} to 10 days later
            execute console command "/tempban %{PunishPlayer::%{_p}%}% 10d X-Ray Hacks (1st Offence) You Will Be Unbanned On %{PunishTime}%"
            delete {PunishTime}
            add 1 to {PunishOffences::%{PunishPlayer::%{_p}%}%}
            close player's inventory
            delete {PunishBroadcast::%{_p}%}
            delete {PunishPlayer::%{_p}%}
                            
        make gui slot 1 with barrier named "&62nd Offence" with lore "":
            add 1 to {PunishOffences::%{PunishPlayer::%{_p}%}%}
            set {PunishTime} to 15 days later
            execute console command "/tempban %{PunishPlayer::%{_p}%}% 15d X-Ray Hacks (2nd Offence) You Will Be Unbanned On %{PunishTime}%"
            delete {PunishTime}
            add 1 to {PunishOffences::%{PunishPlayer::%{_p}%}%}
            close player's inventory   
            delete {PunishBroadcast::%{_p}%}
            delete {PunishPlayer::%{_p}%}
                            
        make gui slot 2 with barrier named "&63rd Offence" with lore "":
            add 1 to {PunishOffences::%{PunishPlayer::%{_p}%}%}
            set {PunishTime} to 30 days later
            execute console command "/tempban %{PunishPlayer::%{_p}%}% 30d X-Ray Hacks (3rd Offence) You Will Be Unbanned On %{PunishTime}%"
            delete {PunishTime}
            add 1 to {PunishOffences::%{PunishPlayer::%{_p}%}%}
            close player's inventory
            delete {PunishBroadcast::%{_p}%}
            delete {PunishPlayer::%{_p}%}                           
                            
        make gui slot 4 with fire charge named "&6Perm" with lore "":
            add 1 to {PunishOffences::%{PunishPlayer::%{_p}%}%}
            execute console command "/ban %{PunishPlayer::%{_p}%}% X-Ray Hacks (Perm)"
            close player's inventory
            delete {PunishOffences::%{PunishPlayer::%{_p}%}%}                           
            delete {PunishBroadcast::%{_p}%}
            delete {PunishPlayer::%{_p}%}
        if {PunishOffences::%{PunishPlayer::%{_p}%}%} is not set:
            make gui slot 8 with paper named "&6This Player Has 0 Offences" with lore ""
        else:
            make gui slot 8 with paper named "&6This Player Has %{PunishOffences::%{PunishPlayer::%{_p}%}%}% Offences" with lore ""
    open last gui to {_p}
    
function FlyPunish(p: player):
    message "hi" to {_p}
    create new gui with virtual chest with 1 row named "&a&lFly Hacks":
        make gui slot 0 with barrier named "&61st Offence" with lore "":
            add 1 to {PunishOffences::%{PunishPlayer::%{_p}%}%}
            set {PunishTime} to 10 days later
            execute console command "/tempban %{PunishPlayer::%{_p}%}% 10d Fly Hacks (1st Offence) You Will Be Unbanned On %{PunishTime}%"
            delete {PunishTime}
            add 1 to {PunishOffences::%{PunishPlayer::%{_p}%}%}
            close player's inventory
            delete {PunishBroadcast::%{_p}%}
            delete {PunishPlayer::%{_p}%}
                            
        make gui slot 1 with barrier named "&62nd Offence" with lore "":
            add 1 to {PunishOffences::%{PunishPlayer::%{_p}%}%}
            set {PunishTime} to 15 days later
            execute console command "/tempban %{PunishPlayer::%{_p}%}% 15d Fly Hacks (2nd Offence) You Will Be Unbanned On %{PunishTime}%"
            delete {PunishTime}
            add 1 to {PunishOffences::%{PunishPlayer::%{_p}%}%}
            close player's inventory   
            delete {PunishBroadcast::%{_p}%}
            delete {PunishPlayer::%{_p}%}
                            
        make gui slot 2 with barrier named "&63rd Offence" with lore "":
            add 1 to {PunishOffences::%{PunishPlayer::%{_p}%}%}
            set {PunishTime} to 30 days later
            execute console command "/tempban %{PunishPlayer::%{_p}%}% 30d Fly Hacks (3rd Offence) You Will Be Unbanned On %{PunishTime}%"
            delete {PunishTime}
            add 1 to {PunishOffences::%{PunishPlayer::%{_p}%}%}
            close player's inventory
            delete {PunishBroadcast::%{_p}%}
            delete {PunishPlayer::%{_p}%}                           
                            
        make gui slot 4 with fire charge named "&6Perm" with lore "":
            add 1 to {PunishOffences::%{PunishPlayer::%{_p}%}%}
            execute console command "/ban %{PunishPlayer::%{_p}%}% Fly Hacks (Perm)"
            close player's inventory
            delete {PunishOffences::%{PunishPlayer::%{_p}%}%}                           
            delete {PunishBroadcast::%{_p}%}
            delete {PunishPlayer::%{_p}%}
        if {PunishOffences::%{PunishPlayer::%{_p}%}%} is not set:
            make gui slot 8 with paper named "&6This Player Has 0 Offences" with lore ""
        else:
            make gui slot 8 with paper named "&6This Player Has %{PunishOffences::%{PunishPlayer::%{_p}%}%}% Offences" with lore ""
    open last gui to {_p}
 
i've been making a gui ban skript or my server for a few hours and i can't get it to run commands anymore
it worked fine before but it just stopped working for some reason
i am using skript 1.14
thanks for any help
here is the skript

Code:
command /punish <offline player>:
    permission: sc.punish
    trigger:
        if {PunishPlayer::%player%} has the permission "sc.punish.exempt":
            message "&cYou Can Not Punish This Player"
        else:
            message "punish command ran"
            create new gui with virtual chest with 1 row named "&a&lPunishments":
                make gui slot 0 with diamond named "&cX-Ray" with lore "":
                    XrayPunish(player)
                make gui slot 1 with feather named "&cFly Hacks" with lore "":
                    FlyPunish(player)
            open last gui to player

command /resetoffence <offline player>:
    trigger:
        if player has the permission "sc.admin":
            delete {PunishOffences::%arg%}
            message "Reset Offences Of %arg%"
        else:
            message "&cYou Do Not Have This Permission"
           
function XrayPunish(p: player):
    message "%{_p}%" to {_p}
    create new gui with virtual chest with 1 row named "&a&lX-Ray Hacks":
        make gui slot 0 with barrier named "&61st Offence" with lore "":
            add 1 to {PunishOffences::%{PunishPlayer::%{_p}%}%}
            set {PunishTime} to 10 days later
            execute console command "/tempban %{PunishPlayer::%{_p}%}% 10d X-Ray Hacks (1st Offence) You Will Be Unbanned On %{PunishTime}%"
            delete {PunishTime}
            add 1 to {PunishOffences::%{PunishPlayer::%{_p}%}%}
            close player's inventory
            delete {PunishBroadcast::%{_p}%}
            delete {PunishPlayer::%{_p}%}
                           
        make gui slot 1 with barrier named "&62nd Offence" with lore "":
            add 1 to {PunishOffences::%{PunishPlayer::%{_p}%}%}
            set {PunishTime} to 15 days later
            execute console command "/tempban %{PunishPlayer::%{_p}%}% 15d X-Ray Hacks (2nd Offence) You Will Be Unbanned On %{PunishTime}%"
            delete {PunishTime}
            add 1 to {PunishOffences::%{PunishPlayer::%{_p}%}%}
            close player's inventory  
            delete {PunishBroadcast::%{_p}%}
            delete {PunishPlayer::%{_p}%}
                           
        make gui slot 2 with barrier named "&63rd Offence" with lore "":
            add 1 to {PunishOffences::%{PunishPlayer::%{_p}%}%}
            set {PunishTime} to 30 days later
            execute console command "/tempban %{PunishPlayer::%{_p}%}% 30d X-Ray Hacks (3rd Offence) You Will Be Unbanned On %{PunishTime}%"
            delete {PunishTime}
            add 1 to {PunishOffences::%{PunishPlayer::%{_p}%}%}
            close player's inventory
            delete {PunishBroadcast::%{_p}%}
            delete {PunishPlayer::%{_p}%}                          
                           
        make gui slot 4 with fire charge named "&6Perm" with lore "":
            add 1 to {PunishOffences::%{PunishPlayer::%{_p}%}%}
            execute console command "/ban %{PunishPlayer::%{_p}%}% X-Ray Hacks (Perm)"
            close player's inventory
            delete {PunishOffences::%{PunishPlayer::%{_p}%}%}                          
            delete {PunishBroadcast::%{_p}%}
            delete {PunishPlayer::%{_p}%}
        if {PunishOffences::%{PunishPlayer::%{_p}%}%} is not set:
            make gui slot 8 with paper named "&6This Player Has 0 Offences" with lore ""
        else:
            make gui slot 8 with paper named "&6This Player Has %{PunishOffences::%{PunishPlayer::%{_p}%}%}% Offences" with lore ""
    open last gui to {_p}
   
function FlyPunish(p: player):
    message "hi" to {_p}
    create new gui with virtual chest with 1 row named "&a&lFly Hacks":
        make gui slot 0 with barrier named "&61st Offence" with lore "":
            add 1 to {PunishOffences::%{PunishPlayer::%{_p}%}%}
            set {PunishTime} to 10 days later
            execute console command "/tempban %{PunishPlayer::%{_p}%}% 10d Fly Hacks (1st Offence) You Will Be Unbanned On %{PunishTime}%"
            delete {PunishTime}
            add 1 to {PunishOffences::%{PunishPlayer::%{_p}%}%}
            close player's inventory
            delete {PunishBroadcast::%{_p}%}
            delete {PunishPlayer::%{_p}%}
                           
        make gui slot 1 with barrier named "&62nd Offence" with lore "":
            add 1 to {PunishOffences::%{PunishPlayer::%{_p}%}%}
            set {PunishTime} to 15 days later
            execute console command "/tempban %{PunishPlayer::%{_p}%}% 15d Fly Hacks (2nd Offence) You Will Be Unbanned On %{PunishTime}%"
            delete {PunishTime}
            add 1 to {PunishOffences::%{PunishPlayer::%{_p}%}%}
            close player's inventory  
            delete {PunishBroadcast::%{_p}%}
            delete {PunishPlayer::%{_p}%}
                           
        make gui slot 2 with barrier named "&63rd Offence" with lore "":
            add 1 to {PunishOffences::%{PunishPlayer::%{_p}%}%}
            set {PunishTime} to 30 days later
            execute console command "/tempban %{PunishPlayer::%{_p}%}% 30d Fly Hacks (3rd Offence) You Will Be Unbanned On %{PunishTime}%"
            delete {PunishTime}
            add 1 to {PunishOffences::%{PunishPlayer::%{_p}%}%}
            close player's inventory
            delete {PunishBroadcast::%{_p}%}
            delete {PunishPlayer::%{_p}%}                          
                           
        make gui slot 4 with fire charge named "&6Perm" with lore "":
            add 1 to {PunishOffences::%{PunishPlayer::%{_p}%}%}
            execute console command "/ban %{PunishPlayer::%{_p}%}% Fly Hacks (Perm)"
            close player's inventory
            delete {PunishOffences::%{PunishPlayer::%{_p}%}%}                          
            delete {PunishBroadcast::%{_p}%}
            delete {PunishPlayer::%{_p}%}
        if {PunishOffences::%{PunishPlayer::%{_p}%}%} is not set:
            make gui slot 8 with paper named "&6This Player Has 0 Offences" with lore ""
        else:
            make gui slot 8 with paper named "&6This Player Has %{PunishOffences::%{PunishPlayer::%{_p}%}%}% Offences" with lore ""
    open last gui to {_p}
Add debug messages at the places where the command should be executed to see if Skript runs that code.
 
i added a debug message after the
make gui slot 0 with diamond named "&cX-Ray" with lore "":
but it didn't run
 
i added a debug message after the
make gui slot 0 with diamond named "&cX-Ray" with lore "":
but it didn't run
Send your Skript, TuSKe and server version. Also, take a look at console (on startup or when clicking the slot) and if there are any errors there, send them
 
for some reason the skript just ran fine, the gui opened how it should even though i didn't change anything
 
Status
Not open for further replies.