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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    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 GUI ban skript not running commands

Discussion in 'Skript' started by commandmaker, May 28, 2019.

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

    commandmaker New Member

    Joined:
    May 27, 2019
    Messages:
    7
    Likes Received:
    0
    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 (Text):
    1. command /punish <offline player>:
    2.     permission: sc.punish
    3.     trigger:
    4.         if {PunishPlayer::%player%} has the permission "sc.punish.exempt":
    5.             message "&cYou Can Not Punish This Player"
    6.         else:
    7.             message "punish command ran"
    8.             create new gui with virtual chest with 1 row named "&a&lPunishments":
    9.                 make gui slot 0 with diamond named "&cX-Ray" with lore "":
    10.                     XrayPunish(player)
    11.                 make gui slot 1 with feather named "&cFly Hacks" with lore "":
    12.                     FlyPunish(player)
    13.             open last gui to player
    14.  
    15. command /resetoffence <offline player>:
    16.     trigger:
    17.         if player has the permission "sc.admin":
    18.             delete {PunishOffences::%arg%}
    19.             message "Reset Offences Of %arg%"
    20.         else:
    21.             message "&cYou Do Not Have This Permission"
    22.            
    23. function XrayPunish(p: player):
    24.     message "%{_p}%" to {_p}
    25.     create new gui with virtual chest with 1 row named "&a&lX-Ray Hacks":
    26.         make gui slot 0 with barrier named "&61st Offence" with lore "":
    27.             add 1 to {PunishOffences::%{PunishPlayer::%{_p}%}%}
    28.             set {PunishTime} to 10 days later
    29.             execute console command "/tempban %{PunishPlayer::%{_p}%}% 10d X-Ray Hacks (1st Offence) You Will Be Unbanned On %{PunishTime}%"
    30.             delete {PunishTime}
    31.             add 1 to {PunishOffences::%{PunishPlayer::%{_p}%}%}
    32.             close player's inventory
    33.             delete {PunishBroadcast::%{_p}%}
    34.             delete {PunishPlayer::%{_p}%}
    35.                            
    36.         make gui slot 1 with barrier named "&62nd Offence" with lore "":
    37.             add 1 to {PunishOffences::%{PunishPlayer::%{_p}%}%}
    38.             set {PunishTime} to 15 days later
    39.             execute console command "/tempban %{PunishPlayer::%{_p}%}% 15d X-Ray Hacks (2nd Offence) You Will Be Unbanned On %{PunishTime}%"
    40.             delete {PunishTime}
    41.             add 1 to {PunishOffences::%{PunishPlayer::%{_p}%}%}
    42.             close player's inventory  
    43.             delete {PunishBroadcast::%{_p}%}
    44.             delete {PunishPlayer::%{_p}%}
    45.                            
    46.         make gui slot 2 with barrier named "&63rd Offence" with lore "":
    47.             add 1 to {PunishOffences::%{PunishPlayer::%{_p}%}%}
    48.             set {PunishTime} to 30 days later
    49.             execute console command "/tempban %{PunishPlayer::%{_p}%}% 30d X-Ray Hacks (3rd Offence) You Will Be Unbanned On %{PunishTime}%"
    50.             delete {PunishTime}
    51.             add 1 to {PunishOffences::%{PunishPlayer::%{_p}%}%}
    52.             close player's inventory
    53.             delete {PunishBroadcast::%{_p}%}
    54.             delete {PunishPlayer::%{_p}%}                          
    55.                            
    56.         make gui slot 4 with fire charge named "&6Perm" with lore "":
    57.             add 1 to {PunishOffences::%{PunishPlayer::%{_p}%}%}
    58.             execute console command "/ban %{PunishPlayer::%{_p}%}% X-Ray Hacks (Perm)"
    59.             close player's inventory
    60.             delete {PunishOffences::%{PunishPlayer::%{_p}%}%}                          
    61.             delete {PunishBroadcast::%{_p}%}
    62.             delete {PunishPlayer::%{_p}%}
    63.         if {PunishOffences::%{PunishPlayer::%{_p}%}%} is not set:
    64.             make gui slot 8 with paper named "&6This Player Has 0 Offences" with lore ""
    65.         else:
    66.             make gui slot 8 with paper named "&6This Player Has %{PunishOffences::%{PunishPlayer::%{_p}%}%}% Offences" with lore ""
    67.     open last gui to {_p}
    68.    
    69. function FlyPunish(p: player):
    70.     message "hi" to {_p}
    71.     create new gui with virtual chest with 1 row named "&a&lFly Hacks":
    72.         make gui slot 0 with barrier named "&61st Offence" with lore "":
    73.             add 1 to {PunishOffences::%{PunishPlayer::%{_p}%}%}
    74.             set {PunishTime} to 10 days later
    75.             execute console command "/tempban %{PunishPlayer::%{_p}%}% 10d Fly Hacks (1st Offence) You Will Be Unbanned On %{PunishTime}%"
    76.             delete {PunishTime}
    77.             add 1 to {PunishOffences::%{PunishPlayer::%{_p}%}%}
    78.             close player's inventory
    79.             delete {PunishBroadcast::%{_p}%}
    80.             delete {PunishPlayer::%{_p}%}
    81.                            
    82.         make gui slot 1 with barrier named "&62nd Offence" with lore "":
    83.             add 1 to {PunishOffences::%{PunishPlayer::%{_p}%}%}
    84.             set {PunishTime} to 15 days later
    85.             execute console command "/tempban %{PunishPlayer::%{_p}%}% 15d Fly Hacks (2nd Offence) You Will Be Unbanned On %{PunishTime}%"
    86.             delete {PunishTime}
    87.             add 1 to {PunishOffences::%{PunishPlayer::%{_p}%}%}
    88.             close player's inventory  
    89.             delete {PunishBroadcast::%{_p}%}
    90.             delete {PunishPlayer::%{_p}%}
    91.                            
    92.         make gui slot 2 with barrier named "&63rd Offence" with lore "":
    93.             add 1 to {PunishOffences::%{PunishPlayer::%{_p}%}%}
    94.             set {PunishTime} to 30 days later
    95.             execute console command "/tempban %{PunishPlayer::%{_p}%}% 30d Fly Hacks (3rd Offence) You Will Be Unbanned On %{PunishTime}%"
    96.             delete {PunishTime}
    97.             add 1 to {PunishOffences::%{PunishPlayer::%{_p}%}%}
    98.             close player's inventory
    99.             delete {PunishBroadcast::%{_p}%}
    100.             delete {PunishPlayer::%{_p}%}                          
    101.                            
    102.         make gui slot 4 with fire charge named "&6Perm" with lore "":
    103.             add 1 to {PunishOffences::%{PunishPlayer::%{_p}%}%}
    104.             execute console command "/ban %{PunishPlayer::%{_p}%}% Fly Hacks (Perm)"
    105.             close player's inventory
    106.             delete {PunishOffences::%{PunishPlayer::%{_p}%}%}                          
    107.             delete {PunishBroadcast::%{_p}%}
    108.             delete {PunishPlayer::%{_p}%}
    109.         if {PunishOffences::%{PunishPlayer::%{_p}%}%} is not set:
    110.             make gui slot 8 with paper named "&6This Player Has 0 Offences" with lore ""
    111.         else:
    112.             make gui slot 8 with paper named "&6This Player Has %{PunishOffences::%{PunishPlayer::%{_p}%}%}% Offences" with lore ""
    113.     open last gui to {_p}
     
  2. TPGamesNL

    Moderator Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,501
    Likes Received:
    108
    Medals:
    Add debug messages at the places where the command should be executed to see if Skript runs that code.
     
  3. commandmaker

    commandmaker New Member

    Joined:
    May 27, 2019
    Messages:
    7
    Likes Received:
    0
    i added a debug message after the
    make gui slot 0 with diamond named "&cX-Ray" with lore "":
    but it didn't run
     
  4. TPGamesNL

    Moderator Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,501
    Likes Received:
    108
    Medals:
    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
     
  5. commandmaker

    commandmaker New Member

    Joined:
    May 27, 2019
    Messages:
    7
    Likes Received:
    0
    for some reason the skript just ran fine, the gui opened how it should even though i didn't change anything
     
  6. TPGamesNL

    Moderator Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,501
    Likes Received:
    108
    Medals:
    Weird...
     
Thread Status:
Not open for further replies.

Share This Page

Loading...