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.

Runakai

Supporter
Apr 27, 2018
496
32
28
21
Hello, its me again :emoji_slight_smile: I am struggling with making a shop skript where you can buy 1 item by leftclicking, selling 1 item by rightclicking an buying/selling 64 by shift+left/rightclicking.

When i use the "On inventory click" event, the" shift" does not work. (Also no errors ingame and in the console)
code_language.skript:
on inventory click:
    if inventory name of player's current inventory is "&cSpawnerkauf":
        clicked slot is 1:
            if clicked type is left mouse button:
                if {coins::%player%} is more than 9999:
                    remove 10000 from {coins::%player%}
                    give player a monster spawner named "&fSpawner"
            if clicked type is left mouse button with shift:
                send "Hello c:"
on inventory click:
    if inventory name of current inventory of player is "&cShop":
        clicked slot is 11:
            open chest with 3 rows named "&cSpawnerkauf" to player
            set slot 1 of player's current inventory to monster spawner 
command /shop:
    trigger:
        open chest with 3 rows named "&cShop" to player
        set slot 10 of player's current inventory to grass named "&cBlöcke"
        set slot 11 of player's current inventory to nether star named "&cBesonderes"

well,. now it does not work and i dont know why. But the part with "shift" didnt work. Is there a way to do it with TuSKe? I saw the Tutorial and tried it but i failed. Can someone give me an example how to do it with removing the items out of the inventory and removen the coins?

Addons:
-Skellet
-SkQuery(Lime)
-Bensku Skript latest version
-SkMorkaz
-TuSKe
-Umbaska
-skRayFall
-MundoSk
 
try:
code_language.skript:
on right click:
    if inventory name of current inventory of player is "&cShop":
        clicked slot is 11:
 
Please, send me your complete code so I can help you.
[doublepost=1524935596,1524934583][/doublepost]Did you add in some script this code that is just below:

code_language.skript:
on inventory click:
      cancel event

If in case you have put this please remove it because this will cancel the event.
 
Please, send me your complete code so I can help you.
[doublepost=1524935596,1524934583][/doublepost]Did you add in some script this code that is just below:

code_language.skript:
on inventory click:
      cancel event

If in case you have put this please remove it because this will cancel the event.
well, the "cancel event" skript is just that player cant remove the item.
[doublepost=1524936191][/doublepost]
Well, that was not what i was asking for. I know how to do it but every time i want to have the "shift+leftklick" click typ it does not recognize it. Even if I put out the "Cancel event" part and moreover it didnt work with what you sent
 
Last edited:
Okay what does
code_language.skript:
on inventory click:
    message "%clicked type%"
result in?
 
It sends <none> when you shift click or it doesn't mention the shift?
 
Okay try updating Skellett and Skript
 
Oh lol. Well good luck with your script
 
Ok @Runakai1 I think I have figured this out.
So using the link that TPGames sent
I ran this and it works (Took a lot of trial and error to get it)
code_language.skript:
on inventory click:
    if clicked type is LEFT mouse:
        send "SELL"
    if clicked type is RIGHT mouse:
        send "BUY"
    if clicked type is right mouse button with shift:
        send "BUY 64"

Make sure you have Skellett installed obviously :emoji_slight_smile:
[doublepost=1524938045,1524938010][/doublepost]It appears i was too late for that response :emoji_wink:
 
Thanks anyways
Ok @Runakai1 I think I have figured this out.
So using the link that TPGames sent
I ran this and it works (Took a lot of trial and error to get it)
code_language.skript:
on inventory click:
    if clicked type is LEFT mouse:
        send "SELL"
    if clicked type is RIGHT mouse:
        send "BUY"
    if clicked type is right mouse button with shift:
        send "BUY 64"

Make sure you have Skellett installed obviously :emoji_slight_smile:
[doublepost=1524938045,1524938010][/doublepost]It appears i was too late for that response :emoji_wink:

Code:
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 "&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 "&cSpawner":
        clicked slot is 0:
            if clicked type is LEFT mouse:
                send "hi"
            else if clicked type is right mouse button:
                send "hi rechts"

Now that part does not work. It won't send me "hi" or "hi rechts"
 
Thanks anyways


Code:
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 "&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 "&cSpawner":
        clicked slot is 0:
            if clicked type is LEFT mouse:
                send "hi"
            else if clicked type is right mouse button:
                send "hi rechts"

Now that part does not work. It won't send me "hi" or "hi rechts"
This may be a stupid question, but are you sure the name of the inventory is currently set properly?
I just copy/pasted your code into a skript, name a chest &cSpawner, and clicked on slot 0 and its returning both Hi and HI RECHTS
 
This may be a stupid question, but are you sure the name of the inventory is currently set properly?
I just copy/pasted your code into a skript, name a chest &cSpawner, and clicked on slot 0 and its returning both Hi and HI RECHTS
Well, yes i have copied it with ctrl+c and then ctrl+v ^^ /And of course i changed &cSpawner with &6Spawner because i was just dumb naming the inventory but anyway now it has the same name and does not work
 
I found your error
  1. open chest with 2 rows named "&6Spawner" to player
  2. set slot 0 of player's current inventory to 52 named "&cSpawner"
  3. stop
  4. else if name of player's current inventory is "&cSpawner":

    You have 2 dif color codes for spawner
 
This may be a stupid question, but are you sure the name of the inventory is currently set properly?
I just copy/pasted your code into a skript, name a chest &cSpawner, and clicked on slot 0 and its returning both Hi and HI RECHTS
I found your error
  1. open chest with 2 rows named "&6Spawner" to player
  2. set slot 0 of player's current inventory to 52 named "&cSpawner"
  3. stop
  4. else if name of player's current inventory is "&cSpawner":

    You have 2 dif color codes for spawner
I saw and edited it, but it still does not work *cry*
 
Status
Not open for further replies.