Solved Custom projectiles

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

JackyBoy

Member
Feb 4, 2017
104
1
18
21
Hi there, I was wondering if there was a way to summon a snowball or something with a custom name. Then make an armor stand follow it and if the ball hits a player they take damage. I am trying to make a custom 3D model item (like a bullet) fly through the air when someone uses it. I also need to make sure that it can be run multiple times and even during mid-flight. Thank you
 
snowball with custom name? I don't think that's possible

well what I would do in your place:
Code:
make player shoot a snowball at speed 1
loop all entities in radius 2 of block at player's head:
  loop-entity is a snowball
  set {_entity} to loop-entity
  set metadata "customprojectile" of loop-entity to true
  exit loop
spawn an armor stand at block 100 meters above player
make spawned armor stand ride {_entity}

on damage of player:
  projectile is a snowball
  metadata "customprojectile" of projectile is set
  set damage to 1
on projectile hit:
  projectile is a snowball
  metadata "customprojectile" of projectile is set
  kill passengers of projectile
untested
 
snowball with custom name? I don't think that's possible

well what I would do in your place:
Code:
make player shoot a snowball at speed 1
loop all entities in radius 2 of block at player's head:
  loop-entity is a snowball
  set {_entity} to loop-entity
  set metadata "customprojectile" of loop-entity to true
  exit loop
spawn an armor stand at block 100 meters above player
make spawned armor stand ride {_entity}

on damage of player:
  projectile is a snowball
  metadata "customprojectile" of projectile is set
  set damage to 1
on projectile hit:
  projectile is a snowball
  metadata "customprojectile" of projectile is set
  kill passengers of projectile
untested
Thanks, the loop doesn't seem to be working though. Do you know how to fix that?
 
Just do
code_language.skript:
on right click holding lead:
    shoot a snowball from player with speed 5


on damage:
    if projectile is a snowball:
    #stuff
 
Status
Not open for further replies.