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

On right click on player

Discussion in 'Skript' started by Dismade, Jul 23, 2017.

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

    Dismade New Member

    Joined:
    Jul 23, 2017
    Messages:
    6
    Likes Received:
    0
    I am attempting to make a staff mode for my server with Skript.
    I have just about everything done, but I am wondering how I can implement an event when I right-click a player with a certain item.

    I've tried it before, and it looked a little something like this:

    on right click on player:
    if player is holding book named "Inventory":
    make player execute command "/inv %clicked entity%"

    It did work, but it also ran the command when I right-clicked a player with ANY item.
     
  2. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    225
    Doing it this way works for me. Just the tool named "Inventory" works here.
    Code (Skript):
    1. on right click on player:
    2.     if tool's name is "Inventory":
    3.         make player execute command "/invsee %clicked entity%"
     
  3. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    225
    Code (Skript):
    1. on right click on a player with a book:
    2.     name of tool is "Inventory":
    3.         execute player command "/inv %clicked entity%"
     
Thread Status:
Not open for further replies.

Share This Page

Loading...