Solved Guishop

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

xXSwainXx

Active Member
Jan 27, 2017
55
5
8
25
Hey Guys,

Have a problem with no errors :emoji_stuck_out_tongue:

it nothing hapends when i rightclick the item and there are no errors on reloading.


code:

code_language.skript:
command /shop2:
    trigger:
        open chest with 6 row named "&8» &cShop" to player
        wait 1 tick
        set {_i} to 0
        loop 53 times:
            format slot 0 of player with blue stained glass pane named " " to be unstealable
            add 1 to {_i}
            {_i} is between 0 and 53:
                format slot {_i} of player with blue stained glass pane named " " to be unstealable
        set slot 1 of current inventory of player to diamond sword named "&8➫ &cSchwerter" with lore "&aKlicke um Schwerter zu Kaufen."
        set slot 2 of player's current inventory to diamond chestplate named "&8➫ &cRüstungen"
        set slot 3 of player's current inventory to bow named "&8➫ &cBögen"
        set slot 4 of player's current inventory to enchantment table named "&8➫ &cNützliches"
        set slot 9 of player's current inventory to gray stained glass pane named " "
        set slot 10 of player's current inventory to gray stained glass pane named " "
        set slot 11 of player's current inventory to gray stained glass pane named " "
        set slot 12 of player's current inventory to gray stained glass pane named " "
        set slot 13 of player's current inventory to gray stained glass pane named " "
        set slot 14 of player's current inventory to gray stained glass pane named " "
        set slot 15 of player's current inventory to gray stained glass pane named " "
        set slot 16 of player's current inventory to gray stained glass pane named " "
        set slot 17 of player's current inventory to gray stained glass pane named " "

on inventory click:
    inventory name of current inventory of player contains "&8» &cShop":
        cancel event
        if clicked item is diamond sword:
            name of clicked item is "&8➫ &cSchwerter":
                send "Mario" to player
                wait 1 ticks
                set slot 1 of current inventory of player to glowing diamond sword named "&8➫ &cSchwerter"
 
xXSwainXx

Remove the "contains" and use "is".

code_language.skript:
on inventory click:
    inventory name of current inventory of player is "&8» &cShop":
        cancel event
        if clicked item is diamond sword:
            name of clicked item is "&8➫ &cSchwerter":
                send "Mario" to player
                wait 1 ticks
                set slot 1 of current inventory of player to glowing diamond sword named "&8➫ &cSchwerter"


 
Skquery: 3.21.4
Skript: 2.2
Umbaska: 2.0 Beta 5.052

Tested many things on the latest versions.
code_language.skript:
on inventory click:
It seems to work only for the "hotbar" click and not for the whole inventory.
You can test that by yourself too.
code_language.skript:
on inventory click:
    broadcast "Item: &5%clicked item%"
Try to click an item in the hotbar and one into the inventory.
 
but on my lottery skript it work??? :emoji_stuck_out_tongue:

and on my friend skript???


code_language.skript:
inventory click:
    inventory name of current inventory of player contains "§8Freunde":
        cancel event
        if clicked item is paper:
            name of clicked item is "§6§lAnfragen"
            close player's inventory
            wait a tick
            execute player command "friend requests"
 
@xXSwainXx

Sorry for the long wait.
code_language.skript:
command /shop2:
    trigger:
        open chest with 6 row named "&8» &cShop" to player
        wait 1 tick
        set {_i} to 0
        loop 53 times:
            format slot 0 of player with blue stained glass pane named " " to be unstealable
            add 1 to {_i}
            {_i} is between 0 and 53:
                set slot {_i} of current inventory of player to blue stained glass pane named " "
        set slot 1 of current inventory of player to diamond sword named "&8➫ &cSchwerter" with lore "&aKlicke um Schwerter zu Kaufen."
        set slot 2 of player's current inventory to diamond chestplate named "&8➫ &cRüstungen"
        set slot 3 of player's current inventory to bow named "&8➫ &cBögen"
        set slot 4 of player's current inventory to enchantment table named "&8➫ &cNützliches"
        set slot 9 of player's current inventory to gray stained glass pane named " "
        set slot 10 of player's current inventory to gray stained glass pane named " "
        set slot 11 of player's current inventory to gray stained glass pane named " "
        set slot 12 of player's current inventory to gray stained glass pane named " "
        set slot 13 of player's current inventory to gray stained glass pane named " "
        set slot 14 of player's current inventory to gray stained glass pane named " "
        set slot 15 of player's current inventory to gray stained glass pane named " "
        set slot 16 of player's current inventory to gray stained glass pane named " "
        set slot 17 of player's current inventory to gray stained glass pane named " "
 
on inventory click:
    inventory name of current inventory of player contains "&8» &cShop":
        cancel event
        if clicked item is diamond sword:
            name of clicked item is "&8➫ &cSchwerter":
                send "Mario" to player
                wait 1 ticks
                set slot 1 of current inventory of player to glowing diamond sword named "&8➫ &cSchwerter"
Fixed & Tested for you
 
Status
Not open for further replies.