I have a skript where I'm trying to make a "mage wand" that casts fire particles in the direction it is shot in, and while i have that working, i want it to deal damage to any players while also burning those that get caught in it, and I can't quite figure out how to do it, can anyone help?
Code:
function line(loc1: location, loc2: location, particle: text):
loop blocks between block at {_loc1} and block at {_loc2}:
show ({_particle} parsed as visual effect) at location of loop-block
on right click with blaze rod:
if {%player%_magecooldown} is false:
set {%player%_magecooldown} to 0
if {%player%_magecooldown} is true:
set {%player%_magecooldown} to 0
if {%player%_magecooldown} is not set:
set {%player%_magecooldown} to 0
else if {%player%_magecooldown} is not 0:
send "&cPlease wait %{%player%_magecooldown}% seconds to use this again!" to player
else if {%player%_magecooldown} is 0:
line(location of player, location of targeted block, "mobspawner flames")
loop all players:
if loop-player is between {_loc1} and {_loc2}:
damage loop-player by 2
send " " to player
send "&6&lMagic Used!" to player
send " " to player
set {%player%_magecooldown} to 15
loop 15 times:
wait 1 second
remove 1 from {%player%_magecooldown}
set {%player%_magecooldown} to 0
send "&aYour magic is ready!" to player