Solved TuSKe Clicktyp

  • 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.
so, i just did this (excuse the rename part, used that to rename a chest)
code_language.skript:
command /rename <text>:
    trigger:
        set name of player's held item to colored arg-1

on inventory click:
    if name of player's current inventory is "&cShop":
        clicked slot is 10:
            open chest with 2 rows named "&6Spawner" to player
            set slot 0 of player's current inventory to 52 named "&cSpawner"
            stop
    else if name of player's current inventory is "&6Spawner":
        clicked slot is 0:
            if clicked type is LEFT mouse:
                send "hi"
            else if clicked type is right mouse button:
                send "hi rechts"
And it works totally fine for me
[doublepost=1524939016,1524938970][/doublepost]NOTE how i open a chest named &6Spawner and check the name of the inventory to &6Spawner
 
so, i just did this (excuse the rename part, used that to rename a chest)
code_language.skript:
command /rename <text>:
    trigger:
        set name of player's held item to colored arg-1

on inventory click:
    if name of player's current inventory is "&cShop":
        clicked slot is 10:
            open chest with 2 rows named "&6Spawner" to player
            set slot 0 of player's current inventory to 52 named "&cSpawner"
            stop
    else if name of player's current inventory is "&6Spawner":
        clicked slot is 0:
            if clicked type is LEFT mouse:
                send "hi"
            else if clicked type is right mouse button:
                send "hi rechts"
And it works totally fine for me
[doublepost=1524939016,1524938970][/doublepost]NOTE how i open a chest named &6Spawner and check the name of the inventory to &6Spawner
When i rename the chest an then click on the slot it does work. But i actually wanted to to this without chest and just with commands
 
I was just using a chest as example, but you have to make sure when you type (open an inventory named "NAME") and (if name of current inventory is "NAME") they have to match names... I changed your little skript there to match the names and it works fine for me, showing the messages in chat and all.

Post your updated skript that is not working
 
I was just using a chest as example, but you have to make sure when you type (open an inventory named "NAME") and (if name of current inventory is "NAME") they have to match names... I changed your little skript there to match the names and it works fine for me, showing the messages in chat and all.

Post your updated skript that is not working
Well, its the same code and the Names match perfectly because i copyed it ^^

code_language.skript:
command /shop:
    trigger:
        open chest with 3 rows named "&cShop" to player
        set slot 10 of player's current inventory to grass named "&6Blöcke"

on inventory click:
    if name of player's current inventory is "&cShop":
        clicked slot is 10:
            open chest with 2 rows named "Buy some Spawners" to player
            set slot 0 of player's current inventory to 52 named "&cSpawner"
    if name of player's current inventory is "Buy some Spawners":
        clicked slot is 0:
            if clicked type is LEFT mouse:
                send "hi"
            else if clicked type is right mouse button:
                send "hi rechts"
 
Well, its the same code and the Names match perfectly because i copyed it ^^

code_language.skript:
command /shop:
    trigger:
        open chest with 3 rows named "&cShop" to player
        set slot 10 of player's current inventory to grass named "&6Blöcke"

on inventory click:
    if name of player's current inventory is "&cShop":
        clicked slot is 10:
            open chest with 2 rows named "Buy some Spawners" to player
            set slot 0 of player's current inventory to 52 named "&cSpawner"
    if name of player's current inventory is "Buy some Spawners":
        clicked slot is 0:
            if clicked type is LEFT mouse:
                send "hi"
            else if clicked type is right mouse button:
                send "hi rechts"
I just popped this into Skript and it works perfectly fine for me
 
I just popped this into Skript and it works perfectly fine for me
It does not work for me. It just works when i click the slot when the inventory was opened by just rightclicking on a normal chest
Edit: I mean in the GUI when rightclicking on a normal chest""
 
When I click it, the words pop up in the chat, and i pick up the item....
Im assuming you are wanting to cancel the click event?
[doublepost=1524939782,1524939722][/doublepost]add cancel event just before the chat message
[doublepost=1524939830][/doublepost]example
code_language.skript:
command /shop:
    trigger:
        open chest with 3 rows named "&cShop" to player
        set slot 10 of player's current inventory to grass named "&6Blöcke"
 
on inventory click:
    if name of player's current inventory is "&cShop":
        clicked slot is 10:
            open chest with 2 rows named "Buy some Spawners" to player
            set slot 0 of player's current inventory to 52 named "&cSpawner"
    if name of player's current inventory is "Buy some Spawners":
        clicked slot is 0:
            if clicked type is LEFT mouse:
                cancel event
                send "hi"
            else if clicked type is right mouse button:
                cancel event
                send "hi rechts"
[doublepost=1524939899][/doublepost]then add all that in, so like, cancel event, give player blah blah, remove # from balance of player
 
When I click it, the words pop up in the chat, and i pick up the item....
Im assuming you are wanting to cancel the click event?
[doublepost=1524939782,1524939722][/doublepost]add cancel event just before the chat message
[doublepost=1524939830][/doublepost]example
code_language.skript:
command /shop:
    trigger:
        open chest with 3 rows named "&cShop" to player
        set slot 10 of player's current inventory to grass named "&6Blöcke"
 
on inventory click:
    if name of player's current inventory is "&cShop":
        clicked slot is 10:
            open chest with 2 rows named "Buy some Spawners" to player
            set slot 0 of player's current inventory to 52 named "&cSpawner"
    if name of player's current inventory is "Buy some Spawners":
        clicked slot is 0:
            if clicked type is LEFT mouse:
                cancel event
                send "hi"
            else if clicked type is right mouse button:
                cancel event
                send "hi rechts"
I tried it and it didn't event cancel the event. I was still able to pick up the item
 
then copy paste your code here, because When I did it, it works perfectly fine for me
Then again im running on 1.12.2 with the current Bensku Build of skript dev35
 
code_language.skript:
command /shop:
    trigger:
        open chest with 3 rows named "&cShop" to player
        set slot 10 of player's current inventory to grass named "&6Blöcke"

on inventory click:
    if name of player's current inventory is "&cShop":
        clicked slot is 10:
            open chest with 2 rows named "Buy some Spawners" to player
            set slot 0 of player's current inventory to 52 named "&cSpawner"
    if name of player's current inventory is "Buy some Spawners":
        clicked slot is 0:
            if clicked type is LEFT mouse:
                cancel event
                send "hi"
            else if clicked type is right mouse button:
                cancel event
                send "hi rechts"
 
let me quickly build a 1.8.8 server and give it a whirl because im confused
[doublepost=1524940938,1524940855][/doublepost]also, for my 1.8.8 test server, which addons are you using?
 
let me quickly build a 1.8.8 server and give it a whirl because im confused
[doublepost=1524940938,1524940855][/doublepost]also, for my 1.8.8 test server, which addons are you using?
Sk Query-Lime
SkMorkaz
Skellet
Skript (obviously)
SkRayFall
Umbaska
TuSKe
MundoSK
 
"Skript (obviously)" thanks for that, made me chuckle, haha!
Ok, so I know most of those are not relevant to this snippet so i will try with a few less,
[doublepost=1524941440,1524941150][/doublepost]AH YOURE RIGHT, the cancel totally doesn't work.... Ok back to my thinking board
 
"Skript (obviously)" thanks for that, made me chuckle, haha!
Ok, so I know most of those are not relevant to this snippet so i will try with a few less,
"Skript (obviously)" thanks for that, made me chuckle, haha!
Ok, so I know most of those are not relevant to this snippet so i will try with a few less,
[doublepost=1524941440,1524941150][/doublepost]AH YOURE RIGHT, the cancel totally doesn't work.... Ok back to my thinking board[/QUOTE

I tried
code_language.skript:
command /shop:
    trigger:
        open chest with 3 rows named "&cShop" to player
        set slot 10 of player's current inventory to grass named "&6Blöcke"

on inventory click:
    if name of player's current inventory is "&cShop":
        clicked slot is 10:
            [U][I][B]open virtual chest inventory named "Buy some Spawners" to player[/B][/I][/U]
            set slot 0 of player's current inventory to 52 named "&cSpawner"
    if name of player's current inventory is "Buy some Spawners":
        clicked slot is 0:
            if clicked type is LEFT mouse:
                cancel event
                send "hi"
            else if clicked type is right mouse button:
                cancel event
                send "hi rechts"

But it also didn't work.
 
ok i figured it out , line 9 i Put "wait 1 tick" dunno why, but it works, i think the second chest was registering TOO fast and was preventing it from working
code_language.skript:
command /shop:
    trigger:
        open chest with 3 rows named "&cShop" to player
        set slot 10 of player's current inventory to grass named "&6Blöcke"
 
on inventory click:
    if name of player's current inventory is "&cShop":
        clicked slot is 10:
            wait 1 tick
            open chest with 2 rows named "Buy some Spawners" to player
            set slot 0 of player's current inventory to 52 named "&cSpawner"
    if name of player's current inventory is "Buy some Spawners":
        clicked slot is 0:
            if clicked type is LEFT mouse:
                cancel event
                send "hi"
            else if clicked type is right mouse button:
                cancel event
                send "hi rechts"
 
ok i figured it out , line 9 i Put "wait 1 tick" dunno why, but it works, i think the second chest was registering TOO fast and was preventing it from working
code_language.skript:
command /shop:
    trigger:
        open chest with 3 rows named "&cShop" to player
        set slot 10 of player's current inventory to grass named "&6Blöcke"
 
on inventory click:
    if name of player's current inventory is "&cShop":
        clicked slot is 10:
            wait 1 tick
            open chest with 2 rows named "Buy some Spawners" to player
            set slot 0 of player's current inventory to 52 named "&cSpawner"
    if name of player's current inventory is "Buy some Spawners":
        clicked slot is 0:
            if clicked type is LEFT mouse:
                cancel event
                send "hi"
            else if clicked type is right mouse button:
                cancel event
                send "hi rechts"
Wow, that worked! Thanks. Wow, this Post was getting out of control haha. Thanks for your patient :emoji_slight_smile:
 
Status
Not open for further replies.