Snowball

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

TDragon_

Active Member
Jul 19, 2018
86
1
0
22
And then, getting to the point. How do I when the player presses right button on an item, type a stick, appears a snowball, or a ball of fire
 
I think it is this you want to do

code_language.skript:
on rightclick:
    if player's tool = stick or fire charge or snowball:

and if you dont want to fire the snow ball use:

code_language.skript:
on rightclick:
    if player's tool = stick or fire charge or snowball:
        cancel event
 
I think it is this you want to do

code_language.skript:
on rightclick:
    if player's tool = stick or fire charge or snowball:

and if you dont want to fire the snow ball use:

code_language.skript:
on rightclick:
    if player's tool = stick or fire charge or snowball:
        cancel event
I wanted it when I clicked on a stick, throwing snowballs or fireballs. And when it hits the player, it has an effect
[doublepost=1540077558,1540060918][/doublepost]Someone?
[doublepost=1540167463][/doublepost]Someone? Help ;-;
 
I wanted it when I clicked on a stick, throwing snowballs or fireballs. And when it hits the player, it has an effect
[doublepost=1540077558,1540060918][/doublepost]Someone?
[doublepost=1540167463][/doublepost]Someone? Help ;-;
Something like this maybe (not tested)?
code_language.skript:
on right click holding stick:
    shoot snowball from player at speed 3
    set metadata "stick" of last spawned snowball to true
    
on projectile hit:
    event-projectile is a snowball
    metadata "stick" of event-projectile is true
    poison victim for 10 seconds
 
Something like this maybe (not tested)?
code_language.skript:
on right click holding stick:
    shoot snowball from player at speed 3
    set metadata "stick" of last spawned snowball to true
   
on projectile hit:
    event-projectile is a snowball
    metadata "stick" of event-projectile is true
    poison victim for 10 seconds
SkDragon?
 
Nope. Any errors?
Just wanted to know if you need some addon
[doublepost=1540236236,1540235534][/doublepost]
Nope. Any errors?
AHR61hR.png
 
[16:28:16 ERROR]: Use 'projectile' and/or 'shooter' in projectile hit events (TD
classes.sk, line 8: poison player for 10 seconds')
Try
code_language.skript:
on right click holding stick:
    shoot snowball from player at speed 3
    set metadata "stick" of last spawned snowball to true
  
on damage:
    event-projectile is set
    event-projectile is a snowball
    metadata "stick" of event-projectile is true
    cancel event
    poison victim for 10 seconds
 
Try
code_language.skript:
on right click holding stick:
    shoot snowball from player at speed 3
    set metadata "stick" of last spawned snowball to true
 
on damage:
    event-projectile is set
    event-projectile is a snowball
    metadata "stick" of event-projectile is true
    cancel event
    poison victim for 10 seconds
When the snowball strikes some mob, or myself, it does not poison
[doublepost=1540489248,1540489216][/doublepost]
Try
code_language.skript:
on right click holding stick:
    shoot snowball from player at speed 3
    set metadata "stick" of last spawned snowball to true
 
on damage:
    event-projectile is set
    event-projectile is a snowball
    metadata "stick" of event-projectile is true
    cancel event
    poison victim for 10 seconds
Only works with players?
 
When the snowball strikes some mob, or myself, it does not poison
[doublepost=1540489248,1540489216][/doublepost]
Only works with players?
Sorry, code was't working.
New code (tested this time):
code_language.skript:
on right click holding stick:
    set {_v} to vector from yaw yaw of player and pitch pitch of player
    set vector length of {_v} to 3
    spawn snowball at player ~ vector 0,1.6,0
    set {_e} to last spawned snowball
    set shooter of {_e} to player
    push {_e} {_v}
    set metadata "stick" of {_e} to true
 
on damage:
    event-projectile is set
    event-projectile is a snowball
    metadata "stick" of event-projectile is true
    poison victim for 10 seconds
 
Status
Not open for further replies.