Detect Player Looking At Player's Eye

  • 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 community!

    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!

PrincePeach_

Member
Nov 18, 2024
2
0
1
So I'm making a thing similar to how endermen work, and it involves looking a player directly in the eye, as of now I only have it so that it detects the player is looking at the ender-like player. The issue is that it still triggers even if they aren't looking directly into the eyes.


Code:
<condition involving `target of event-player`>:
    <effect>
 
I don't really understand what you are asking. Can you please provide more info? I also don't see any real code to base this issue on.
 
I don't really understand what you are asking. Can you please provide more info? I also don't see any real code to base this issue on.
Sorry for being vague, I am attempting to recreate origins in skript, and for the Enderian origin I wanted to make a power where when they are looked at in the eyes, they get slowness 10 and strength 5. Here's my current condition check. And this does work, but I want it to be specifically they have to lock eyes, not back of the head, not body, but eyes. I'm just unsure how I would go about doing that.


Code:
if {Origins::%getOrigin({origin.%uuid of (target of {_p})%})%.powers::*} contains "anxiety":
    apply potion of slow 10 without particles to target of {_p} for 0.5 second replacing the existing effect
    apply potion of strength 5 without particles to target of {_p} for 0.5 second replacing the existing effect
 
I really wish I could help, but I'm not even sure if there is a way to do this...
 
Sorry for being vague, I am attempting to recreate origins in skript, and for the Enderian origin I wanted to make a power where when they are looked at in the eyes, they get slowness 10 and strength 5. Here's my current condition check. And this does work, but I want it to be specifically they have to lock eyes, not back of the head, not body, but eyes. I'm just unsure how I would go about doing that.


Code:
if {Origins::%getOrigin({origin.%uuid of (target of {_p})%})%.powers::*} contains "anxiety":
    apply potion of slow 10 without particles to target of {_p} for 0.5 second replacing the existing effect
    apply potion of strength 5 without particles to target of {_p} for 0.5 second replacing the existing effect
Here's probably how you could do this:
Create an invisible small armor stand (Or Display Entity) at the player's head. When the other player looks at that armor stand OR display entity, you would then trigger your code.
 
Here's probably how you could do this:
Create an invisible small armor stand (Or Display Entity) at the player's head. When the other player looks at that armor stand OR display entity, you would then trigger your code.
at all times tho?