on rightclick on sign

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

Carlo Verhamme

New Member
Jul 28, 2017
5
0
0
20
So I am making so when you click on a sign it opens a gui for you.
This is my current code:

code_language.skript:
on right click on sign:
    1st line of clicked block is "&0[&5TreinTickets&0]"
    open chest with 3 rows named "{@menu-naam}" to player
    wait 1 tick
    set {_slot} to 0
    loop 28 times:
        format slot {_slot} of player with 160:5
        add 1 to {_slot}
    format slot 13 of player with paper named "&5Trein Ticket" with lore "&7Klik op mij om een trein ticket te krijgen!" to close then run [execute console command "/giveticket %player%"]

This is the error I get:
code_language.skript:
[12:51:37 ERROR]: 'player with 160:5' is not an item stack (ticketsysteem.sk, line 15: format slot {_slot} of player with 160:5')

and when I click the sign. Nothing happens
 
I know the solution there is a java bug sign's first charter seems white on java and you must write after 160:5 to be unstealable, here is correct code:

code_language.skript:
on right click on sign:
    1st line of clicked block is "[&5TreinTickets&0]"
    open chest with 3 rows named "{@menu-naam}" to player
    wait 1 tick
    loop 27 times:
        format slot loop-number - 1 of player with 160:5 to be unstealable
    format slot 13 of player with paper named "&5Trein Ticket" with lore "&7Klik op mij om een trein ticket te krijgen!" to close then run [execute console command "/giveticket %player%"]
 
Status
Not open for further replies.