1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT??:

    You can always check our our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Right click whilst sneaking

Discussion in 'Skript' started by Cooleeo, Apr 26, 2018.

Thread Status:
Not open for further replies.
  1. Cooleeo

    Cooleeo Member

    Joined:
    Apr 18, 2018
    Messages:
    17
    Likes Received:
    1
    so, i'm trying to create an effect when a player right clicks whilst sneaking. the code that i have only executes if a player right clicks a block when sneaking. how can i make it so the effect executes when a player right clicks in general whilst sneaking?

    Code (Skript):
    1. on rightclick:
    2.     if player is sneaking:
    3.         message "test"
    thanks in advance

     
  2. Best Answer:
    Post #7 by ShaneBee, Apr 26, 2018
  3. XSKRIPTX

    XSKRIPTX Well-Known Member

    Joined:
    Dec 26, 2017
    Messages:
    47
    Likes Received:
    1
    Code (Skript):
    1. on right click on stone:
    2.     if player is sneaking:
    3.         send "yay"
    Code (Skript):
    1. on right click:
    2.     if player is holding stick:
    3.         if player is sneaking:
    4.             send "yay"
     
  4. Cooleeo

    Cooleeo Member

    Joined:
    Apr 18, 2018
    Messages:
    17
    Likes Received:
    1
    sorry I must have not worded that correctly, I'm looking for an event where a player is sneaking and right-clicks in general, as in, like in the air, not necessarily on blocks or with an item held.
     
  5. XSKRIPTX

    XSKRIPTX Well-Known Member

    Joined:
    Dec 26, 2017
    Messages:
    47
    Likes Received:
    1
    ehm
    Code (Skript):
    1. every 5 seconds:
    2.     loop all players:
    3.         loop-player is sneaking:
    4.             send "yay" to loop-player
    for what mini-game or server?
     
  6. Cooleeo

    Cooleeo Member

    Joined:
    Apr 18, 2018
    Messages:
    17
    Likes Received:
    1
    I wanted to create a menu that opens up when a player right clicks whilst sneaking, as it would be quick access and wouldn't take up space in the hotbar. I just need the event, if its possible
     
  7. XSKRIPTX

    XSKRIPTX Well-Known Member

    Joined:
    Dec 26, 2017
    Messages:
    47
    Likes Received:
    1
    Code (Skript):
    1. on rightclick:
    2.     if player is sneaking:
    3.         open chest with 5 rows named "yay2" to player
    4.         send "yay"
     
  8. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    I didn’t know this until every recently, but I just read that when a player right clicks on air, that the client does not send that info to the server.
    So from my understanding it’s not possible
     
    • Informative Informative x 1
  9. Donut

    Addon Developer

    Joined:
    Mar 27, 2017
    Messages:
    1,340
    Likes Received:
    175
    Medals:
    That’s true!
     
    #8 Donut, Apr 26, 2018
    Last edited: Apr 26, 2018
  10. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    Maybe it was something about Skript I read then, or maybe whatever i read was wrong and I was LIED TO... damn them,,, DAMN THEM!
    But come to think of it youre right.... I think it does register it, because i remember helping someone out and I did my on click event with a potato in my hand, and i was clicking air, and it registered.
     
  11. Donut

    Addon Developer

    Joined:
    Mar 27, 2017
    Messages:
    1,340
    Likes Received:
    175
    Medals:
    wait no actually i was wrong it doesnt trigger at all for rightclicking air
     
  12. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    Oh youre right... I think what i read was "When a player clicks on AIR with an EMPTY HAND it does not send to the server"
     
  13. TPGamesNL

    TPGamesNL Well-Known Member

    Joined:
    Jan 20, 2018
    Messages:
    1,311
    Likes Received:
    73
    Medals:
    From http://en.njol.ch/projects/skript/doc/events#click
     
  14. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    Ah yes, thats the thing I read
     
Thread Status:
Not open for further replies.
Loading...