1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved 'on projectile hit' victim.

Discussion in 'Skript' started by NCSGeek, Mar 24, 2018.

Thread Status:
Not open for further replies.
  1. NCSGeek

    NCSGeek Member

    Joined:
    Jul 22, 2017
    Messages:
    19
    Likes Received:
    3
    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 (Skript):
    1.  
    2.         on projectile hit:
    3.     projectile is a snowball
    4.     apply slowness 2 to the target
    5.  
    Errors on Reload:

    Code (Skript):
    1. 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
     
  2. Best Answer:
    Post #2 by HackerOTVW, Mar 24, 2018
  3. HackerOTVW

    HackerOTVW Active Member

    Joined:
    Sep 10, 2017
    Messages:
    91
    Likes Received:
    2
    I encountered the same problem and then i used this instead:
    Code (Skript):
    1. on damage:
    2.     projectile exists
    3.     projectile is a snowball
    4.     #your code
     
    • Useful Useful x 1
  4. NCSGeek

    NCSGeek Member

    Joined:
    Jul 22, 2017
    Messages:
    19
    Likes Received:
    3
    I will try this, thanks. Seems a little finicky though, Snowballs dont cause damage, so how would this work?
     
  5. Donut

    Donut Well-Known Member

    Joined:
    Mar 27, 2017
    Messages:
    1,340
    Likes Received:
    176
    Medals:
    Capture.PNG

    Capture2.PNG
    it doesnt matter if the projectile is a snowball
     
  6. NCSGeek

    NCSGeek Member

    Joined:
    Jul 22, 2017
    Messages:
    19
    Likes Received:
    3
    With `on projectile hit`, yes, but you used `on damage:`. Did you mean to put your code *underneath* my `on projectile hit:`?
     
  7. Donut

    Donut Well-Known Member

    Joined:
    Mar 27, 2017
    Messages:
    1,340
    Likes Received:
    176
    Medals:
    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
     
  8. NCSGeek

    NCSGeek Member

    Joined:
    Jul 22, 2017
    Messages:
    19
    Likes Received:
    3
    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.
    --- Double Post Merged, Mar 25, 2018, Original Post Date: Mar 25, 2018 ---
    But yeah, Well I'll be. This works!
    Code (Text):
    1.  
    2. on damage:
    3.     projectile exists
    4.     projectile is a snowball
    5.     #your code
    6.  
     
Thread Status:
Not open for further replies.

Share This Page

Loading...