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.

SammKiller

New Member
Dec 6, 2021
8
0
1
on right click on player:
set {_hitlocation} to location of victim
wait 1 tick
teleport victim to {_hitlocation}
push victim up with force 0
push victim in direction of attacker with force 0
if victim is player:
if attacker is player:
make victim execute command "/malza"


My goal is to make that when a player right-click on another player, make that player execute a command

If anyone can help me, I appreciate it
 
there is no attacker an victim with a right click event..
here is a fix:
Code:
on right click:
  if target player is set:
    make target player execute command "/malza"
or how your code works:

Code:
on right click:
  if target player is set:
    set {_hitlocation} to target player's location
    wait 1 tick
    teleport target player to {_hitlocation}
    push target player up with force 0
    push victim in direction of attacker with force 0
    make target player execute command "/malza"

Hope i helped! :emoji_smile:
 
Status
Not open for further replies.