Hello, I am Narfic. I was working on a script to make a shotgun and wanted the distance to between the victim and shooter to correlate to the amount of hearts the victim took. (Also: The indentation is correct the forum just makes it all go to the left I believe.)
For some reason, instead of taking damage corresponding to the length the victim only take 0.5 hearts every time. Any information would help, thank you in advanced.
Code:
on damage:
if event-projectile is arrow:
if {power.%shooter%} = 3:
set {_loc.%victim%} to location of block at location of victim
wait 1 tick
if distance between the shooter and {_loc.%victim%} is smaller than 3:
damage victim by 6 hearts
else if distance between the shooter and {_loc.%victim%} is smaller than 6:
damage victim by 4 hearts
else if distance between the shooter and {_loc.%victim%} is smaller than 9:
damage victim by 2 hearts
else:
damage victim by 0.5 hearts
Last edited: