Solved help; identify the On Damage of player event's item used

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

drillzy

Member
Aug 6, 2017
22
0
0
20
Hello, i would like to request some help on identifying the item used in On Damage of player: event
how would i do that?
 
there might be event-item but this definitely works:
code_language.skript:
attacker's tool
 
there might be event-item but this definitely works:
code_language.skript:
attacker's tool
Yea event-item doesn't work. but attacker's tool works, thank you. 1 more question. How do i make it do the event for people in other gamemodes and not just survival?
 
well since they dont take damage you would need to use on leftclick on player
 
well since they dont take damage you would need to use on leftclick on player
It does not work. Gives me error:
A leftclick on an entity is an attack and thus not covered by the 'click' event, but the 'damage' event.
 
In that case i guess you could check if targeted player is set and also check if theyre close to the player who clicked
 
In that case i guess you could check if targeted player is set and also check if theyre close to the player who clicked
How would i do that? Please provide an example if you could and i will apply it myself. Thank you!
 
code_language.skript:
on leftclick:
    if targeted player is set:
        if distance between targeted player and player is less than 5: #might wanna change 5, idk what the hit distance is
             #do stuff
 
code_language.skript:
on leftclick:
    if targeted player is set:
        if distance between targeted player and player is less than 5: #might wanna change 5, idk what the hit distance is
             #do stuff
ok that brought me closer, now there is another problem. It doesn't select the player when i try to left click him, but when I hit the block near the player, then it gets the player. This is wierd :emoji_frowning:
 
Status
Not open for further replies.