GUI Skript - Internal Error

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

itz_mw2004

Member
Feb 10, 2021
1
0
1
19
command /punish <player>:
permission: punish.mc
trigger:
open virtual chest with size 3 named "&6Mega&fCraft Punishment" to player
format gui slot 0 of player with diamond axe named "&4Ban" to run:
ban arg-1

unknown.png


I am trying to make a punishment gui for my server but whenever I try and run the skript it comes up with an internal error, however when reloading the skript it does not show any errors

Yes I do have tuske installed
 
Don't use "format slot" to create GUIs, just Skript will do.
Code:
command /punish <player>:
    permission: punish.mc
    trigger:
        set {_menu} to chest with 3 rows named "&6Mega&fCraft Punishment"
        set slot 0 of {_menu} to diamond axe named "&4Ban"
        set metadata value "toBan" of player to arg-1
        open {_menu} to player

on inventory click:
    name of event-inventory is "&6Mega&fCraft Punishment"
    cancel event
    if name of event-slot is "&4Ban":
        set {_player} to metadata value "toBan" of player
        ban {_player}
 
  • Like
Reactions: TehCheetah
Code:
name of event-inventory is "&6Mega&fCraft Punishment"

This will spam your console after minecraft 1.13.

Code:
In 1.13+ you cannot get the title name of an inventory outside of an InventoryClickEvent. Only if this inventory has an InventoryHolder may it be used in this state.

Check out this thread on how to properly manage which GUI your players currently are using without having to get the name of it
 
  • Like
Reactions: PatoFrango
Code:
name of event-inventory is "&6Mega&fCraft Punishment"

This will spam your console after minecraft 1.13.

Code:
In 1.13+ you cannot get the title name of an inventory outside of an InventoryClickEvent. Only if this inventory has an InventoryHolder may it be used in this state.

Check out this thread on how to properly manage which GUI your players currently are using without having to get the name of it
That sucks, I wasn’t aware of this. I’ve been using Skript on 1.12 for years so I might be a little outdated on some matters
 
That sucks, I wasn’t aware of this. I’ve been using Skript on 1.12 for years so I might be a little outdated on some matters

Definitely. However it's much more clean and efficient to set a variable to your current inventory and checking for it, rather than actually checking for the name.

Used get-inventory-name a lot in the past as well, but I guess you learn something new every day :emoji_stuck_out_tongue:
[doublepost=1613033684,1613033607][/doublepost]
command /punish <player>:
permission: punish.mc
trigger:
open virtual chest with size 3 named "&6Mega&fCraft Punishment" to player
format gui slot 0 of player with diamond axe named "&4Ban" to run:
ban arg-1

unknown.png


I am trying to make a punishment gui for my server but whenever I try and run the skript it comes up with an internal error, however when reloading the skript it does not show any errors

Yes I do have tuske installed

Internal errors often have to do with your skript- and or addon version being off. What version is your server, and what version of skript are you running?
 
Definitely. However it's much more clean and efficient to set a variable to your current inventory and checking for it, rather than actually checking for the name.

Used get-inventory-name a lot in the past as well, but I guess you learn something new every day :emoji_stuck_out_tongue:
[doublepost=1613033684,1613033607][/doublepost]

Internal errors often have to do with your skript- and or addon version being off. What version is your server, and what version of skript are you running?
Yeah, the only problem is having to code the deletion of the variable, like when the inventory closes and etc
 
Yeah, the only problem is having to code the deletion of the variable, like when the inventory closes and etc

I managed to do it in a simple and effective way:
Code:
on inventory close:
     {var::%player%} is set:
          clear {var::%player%}
 
I managed to do it in a simple and effective way:
Code:
on inventory close:
     {var::%player%} is set:
          clear {var::%player%}
Skript stop event too (and I think quit as well since inventory close doesnt get called when a player disconnects). But yeah, I remembered I could just assign a string to a {gui::%player%} variable as the menu’s “id” and then check the variable for that ID
 
Status
Not open for further replies.