On right click on player

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

Dismade

New Member
Jul 23, 2017
6
0
0
20
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.
 
Doing it this way works for me. Just the tool named "Inventory" works here.
code_language.skript:
on right click on player:
    if tool's name is "Inventory":
        make player execute command "/invsee %clicked entity%"
 
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.
code_language.skript:
on right click on a player with a book:
    name of tool is "Inventory":
        execute player command "/inv %clicked entity%"
 
Status
Not open for further replies.