Solved 'on projectile hit' victim.

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

NCSGeek

Member
Jul 22, 2017
19
3
0
I need to apply slowness to the victim on a snowball. But I cant find how to do so in the forums or the docs.


Skript Version: Skript v2.2-dev34
Skript Author: Bensku
Minecraft Version: 1.11.2
---

code_language.skript:
        on projectile hit:
	projectile is a snowball
	apply slowness 2 to the target

Errors on Reload:

code_language.skript:
Use 'projectile' and/or 'shooter' in projectile hit events (server.sk, line 145: apply slowness 2 to the target'

Addons using (including versions):
None.


Have you tried searching the docs? Yes
Have you tried searching the forums? Yes
 
I need to apply slowness to the victim on a snowball. But I cant find how to do so in the forums or the docs.


Skript Version: Skript v2.2-dev34
Skript Author: Bensku
Minecraft Version: 1.11.2
---

code_language.skript:
        on projectile hit:
    projectile is a snowball
    apply slowness 2 to the target

Errors on Reload:

code_language.skript:
Use 'projectile' and/or 'shooter' in projectile hit events (server.sk, line 145: apply slowness 2 to the target'

Addons using (including versions):
None.


Have you tried searching the docs? Yes
Have you tried searching the forums? Yes
I encountered the same problem and then i used this instead:
code_language.skript:
on damage:
    projectile exists
    projectile is a snowball
    #your code
 
I encountered the same problem and then i used this instead:
code_language.skript:
on damage:
    projectile exists
    projectile is a snowball
    #your code

I will try this, thanks. Seems a little finicky though, Snowballs dont cause damage, so how would this work?
 
Capture.PNG


Capture2.PNG

it doesnt matter if the projectile is a snowball
 
i was showing you how the projectile event says to use the damage event to detect projectiles hitting players and the snowball is a projectile so therefore you use the on damage event even though the damage dealt is 0
 
i was showing you how the projectile event says to use the damage event to detect projectiles hitting players and the snowball is a projectile so therefore you use the on damage event even though the damage dealt is 0

I assumed that damage was indicated by the player flashing red (and usually being knocked back too), but since snowballs have no effect to players, this is why I thought the damage event wasnt usable here.
[doublepost=1521938248,1521937921][/doublepost]But yeah, Well I'll be. This works!
Code:
on damage:
    projectile exists
    projectile is a snowball
    #your code
 
Status
Not open for further replies.