Solved gui 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.
Feb 10, 2021
18
0
1
22
  1. Script Version: 2.3.5
  2. Script Author: bensku
  3. Minecraft Version: 1.16.4
  4. Full Code:
  5. command /punish <player>:
    trigger:
    set metadata tag "BanInvMeta01" of player to chest inventory with 1 row named "&8Punish"
    set slot 4 of metadata tag "BanInvMeta01" of player to arg 1's head named "%arg-1%" with lore "&c&lPick their punishment"
    open (metadata tag "BanInvMeta01" of player) to player
    send "&6Pick who u wanna &c&lPunish!" to player
    set {argument.var} to "arg 1"

    on inventory click:
    event-inventory = (metadata tag "BanInvMeta01" of player):
    index of event-slot = 4:
    cancel event
    set metadata tag "BanInv2Meta01" of player to chest inventory with 3 row named "&8Pick the punishment"
    set slot 13 of metadata tag "BanInv2Meta01" of player to {argument.var}'s head named "%{argument.var}%" with lore "test"
    open (metadata tag "BanInv2Meta01" of player) to player



  6. Errors on Reload:

  7. no error just doesnt work

  8. Console Errors: (if applicable)
  9. no errors

  10. Other Useful Info:

  11. Addons using (including versions):
  12. erzats skdragon tuske
  13. Troubleshooting:

  14. Have you tried searching the docs? yes
    [*]Have you tried searching the Forums? yes
    [*]What other methods have you tried to fix it?
  15. replacing some of the code
 
i would recommend using

open a chest with 3 rows named "your name"
format slot 1 of player with grass block named "Your name" to close then run "your command"

then you dont need to use on inventory click
 
  1. Script Version: 2.3.5
  2. Script Author: bensku
  3. Minecraft Version: 1.16.4
  4. Full Code:
  5. command /punish <player>:
    trigger:
    set metadata tag "BanInvMeta01" of player to chest inventory with 1 row named "&8Punish"
    set slot 4 of metadata tag "BanInvMeta01" of player to arg 1's head named "%arg-1%" with lore "&c&lPick their punishment"
    open (metadata tag "BanInvMeta01" of player) to player
    send "&6Pick who u wanna &c&lPunish!" to player
    set {argument.var} to "arg 1"

    on inventory click:
    event-inventory = (metadata tag "BanInvMeta01" of player):
    index of event-slot = 4:
    cancel event
    set metadata tag "BanInv2Meta01" of player to chest inventory with 3 row named "&8Pick the punishment"
    set slot 13 of metadata tag "BanInv2Meta01" of player to {argument.var}'s head named "%{argument.var}%" with lore "test"
    open (metadata tag "BanInv2Meta01" of player) to player



  6. Errors on Reload:

  7. no error just doesnt work

  8. Console Errors: (if applicable)
  9. no errors

  10. Other Useful Info:

  11. Addons using (including versions):
  12. erzats skdragon tuske
  13. Troubleshooting:

  14. Have you tried searching the docs? yes
    [*]Have you tried searching the Forums? yes
    [*]What other methods have you tried to fix it?
  15. replacing some of the code
When writing code, be sure to write it within the code format.

Leaving that aside, you have to look at some basic errors in your script. For example:
code_language.skript:
set {argument.var} to "arg 1"

Change it to:
code_language.skript:
set {argument.var.%player%} to arg 1
So that should set the variable {argument.var.%player%} with the player's name at the head of argument 1.

code_language.skript:
set slot 13 of metadata tag "BanInv2Meta01" of player to {argument.var.%player%}'s head named "%{argument.var.%player%}%" with lore "Test"
 
k
[doublepost=1614766707,1614766090][/doublepost]command /punish <player>:
trigger:
set metadata tag "BanInvMeta01" of player to chest inventory with 1 row named "&8Punish"
set slot 4 of metadata tag "BanInvMeta01" of player to arg 1's head named "%arg-1%" with lore "&c&lPick their punishment"
open (metadata tag "BanInvMeta01" of player) to player
send "&6Pick who u wanna &c&lPunish!" to player
set {argument.var} to arg 1

on inventory click:
event-inventory = (metadata tag "BanInvMeta01" of player):
index of event-slot = 4:
cancel event
set metadata tag "BanInv2Meta01" of player to chest inventory with 3 row named "&8Pick the punishment"
set slot 13 of metadata tag "BanInv2Meta01" of player to {argument.var.%player%}'s head named "%{argument.var.%player%}%" with lore "Test"
open (metadata tag "BanInv2Meta01" of player) to player
Code:
command /punish <player>:
    trigger:
        set metadata tag "BanInvMeta01" of player to chest inventory with 1 row named "&8Punish"
        set slot 4 of metadata tag "BanInvMeta01" of player to arg 1's head named "%arg-1%" with lore "&c&lPick their punishment"
        open (metadata tag "BanInvMeta01" of player) to player
        send "&6Pick who u wanna &c&lPunish!" to player
        set {argument.var} to arg 1
 
on inventory click:
    event-inventory = (metadata tag "BanInvMeta01" of player):
        index of event-slot = 4:
            cancel event
            set metadata tag "BanInv2Meta01" of player to chest inventory with 3 row named "&8Pick the punishment"
            set slot 13 of metadata tag "BanInv2Meta01" of player to {argument.var.%player%}'s head named "%{argument.var.%player%}%" with lore "Test"
            open (metadata tag "BanInv2Meta01" of player) to player

it doesnt give a message but it wont appear
[doublepost=1614821334][/doublepost]dont mind it not being a .%player% i fixed it but it still doesnt work
[doublepost=1614821509][/doublepost]alright. alright. u dont need to reply i fixed some simple errors and it worked.
 
Status
Not open for further replies.