Hey I'm having an issue with my little project here. When a player right clicks a red candle, it launches a snowball with a smoke trail that will explode on impact. The explosion part works fine; however, when multiple snowballs are shot, after the first one explodes all the remaining snowballs lose their particle trails.
Also is there a way to only have the snowball that's spawned from the script have these properties? At the moment every snowball executes this.
I'm very new to skript, so apologies if this is a very simple fix. Thanks!
Also is there a way to only have the snowball that's spawned from the script have these properties? At the moment every snowball executes this.
Code:
# Dynamite Throwing Action
on leftclick holding red candle:
if name of event-item is "&cDynamite":
make the player shoot a snowball at speed 1
play sound "entity.tnt.primed" with volume 3 and pitch 2
if player's gamemode is creative:
stop
else:
remove 1 red candle named "&cDynamite" from player's inventory
# Projectile Trail
on shoot:
projectile is a snowball
set {p-s-dtrail.%shooter%} to 1
loop 1000 times:
if {p-s-dtrail.%shooter%} is 1:
wait 1 tick
play smoke particle at location of projectile
# Explosion Event
on projectile hit:
projectile is a snowball
create an explosion of force 1.8 at the projectile
set {p-s-dtrail.%shooter%} to 0
I'm very new to skript, so apologies if this is a very simple fix. Thanks!