player head in gui

  • 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 community!

    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.
Feb 10, 2021
18
0
1
  1. Script Version: 2.5.3
  2. Script Author: bensku
  3. Minecraft Version: 1.16.4
  4. Full Code:
  5. command /ban <player>:
    trigger:
    set {_p} to "%arg-1%" parsed as player
    format gui slot 4 of player with player's head of ("arg-1" parsed as offline player) named "Player Skull" with lore "test"
    open chest with 1 rows named "&8[ &aMenu &8]" to player
  6. Errors on Reload:
    [*]"arg-1" parsed as a offline player is neither an item type nor an inventory type (ban.sk, line 4: format gui slot 4 of player with player's head of ("arg-1" parsed as offline player) named "Player Skull" with lore "test"')
    [*]Console Errors:
    [*]none
    [*]

    [*]Other Useful Info:
    [*]

    [*]Addons using (including versions):
    [*]skdragon skellett tuske
    [*]Troubleshooting:
    [*]

    [*]Have you tried searching the docs? yes
    [*]Have you tried searching the Forums? yes
    [*]What other methods have you tried to fix it?

    [*]changing alot of the code
 
  1. Script Version: 2.5.3
  2. Script Author: bensku
  3. Minecraft Version: 1.16.4
  4. Full Code:
  5. command /ban <player>:
    trigger:
    set {_p} to "%arg-1%" parsed as player
    format gui slot 4 of player with player's head of ("arg-1" parsed as offline player) named "Player Skull" with lore "test"
    open chest with 1 rows named "&8[ &aMenu &8]" to player
  6. Errors on Reload:
    [*]"arg-1" parsed as a offline player is neither an item type nor an inventory type (ban.sk, line 4: format gui slot 4 of player with player's head of ("arg-1" parsed as offline player) named "Player Skull" with lore "test"')
    [*]Console Errors:
    [*]none
    [*]

    [*]Other Useful Info:
    [*]

    [*]Addons using (including versions):
    [*]skdragon skellett tuske
    [*]Troubleshooting:
    [*]

    [*]Have you tried searching the docs? yes
    [*]Have you tried searching the Forums? yes
    [*]What other methods have you tried to fix it?

    [*]changing alot of the code
I recommend make Inventory GUIs like this:

code_language.skript:
command /ban <player>:
    trigger:
        set metadata tag "BanInvMeta01" of player to chest inventory with 1 row named "&8[&aMenu&8]"

        set slot 4 of metadata tag "BanInvMeta01" of player to arg 1's head named "Player Skull" with lore "test"

        open (metadata tag "BanInvMeta01" of player) to player

#Then
on inventory click:
    event-inventory = (metadata tag "BanInvMeta01" of player):
        #do stuff

For more info about this see the Vanilla GUIs tutorial.

Also, you dont need parse arg 1 as a player when you already put the argument as a player entity
code_language.skript:
command /ban <player>: #<--

And the formatting should be like this:
code_language.skript:
#In SkQuery, but, this is buggy so i recommend you use TuSKe or Vanilla inventories instead.
format slot 4 of player with arg 1's head named "Player skull" with lore "test"


#In TuSke
format a gui slot 4 of player with arg 1's head to close:
    #Do stuff when you click this slot

#And as i said, in vanilla:
set slot 4 of metadata tag "InventoryMetaData" of player to arg 1's head named "Player Skull" with lore "test"
 
Status
Not open for further replies.