Solved Making a right click event cancel if the player is looking at a block.

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

GreatKnightJ

New Member
Dec 20, 2017
5
0
0
29
Essentially I've made a script such that when a certain item is right clicked, it shoots a fireball with a "safe" explosion, but I don't players to accidentally trigger it by interacting with blocks as one can currently, because this could cause them to damage pets etc. in their home. Any advice on how to do this?
 
code_language.skript:
on rightclick:
  if targeted block is set:
    if targeted block is grass:
      cancel event
      send "You can't rightclick on this block" to player
      stop
  else if targeted block is not set:
    stop
I don't know if this can help you
 
code_language.skript:
on rightclick:
  if targeted block is set:
    if targeted block is grass:
      cancel event
      send "You can't rightclick on this block" to player
      stop
  else if targeted block is not set:
    stop
I don't know if this can help you
I might be using your code wrong, but it didn't work for me. I'm reffering specifically to blocks that are close enough for a player to interact with (break).
I want players to be able to shoot at a structure as long as it's not close enough for them to be interacting with, because if it is that close, chances are they were just trying to open a door or container.
 
I might be using your code wrong, but it didn't work for me. I'm reffering specifically to blocks that are close enough for a player to interact with (break).
I want players to be able to shoot at a structure as long as it's not close enough for them to be interacting with, because if it is that close, chances are they were just trying to open a door or container.
Use clicked block
 
Status
Not open for further replies.