Hi,
So I’m trying to code some kind of sentry that shoots one pig at a time in a radius of 5.
The thing is, I have multiple sentries set up and each one of them should work individually. The problem here is when one of them detects a pig, the other ones start shooting at it too, even if it’s not inside a radius of 5.
Keep in mind that every sentry is an amor stand as has the name “sentry” on it.
EDIT: Also, forgot to say that if it’s just one pig that’s in one of the sentry’s radius the other ones won’t detect it, being this what was supposed to happen. If more than one pig steps on the sentrys radius, all of them start shooting at it.
So I’m trying to code some kind of sentry that shoots one pig at a time in a radius of 5.
The thing is, I have multiple sentries set up and each one of them should work individually. The problem here is when one of them detects a pig, the other ones start shooting at it too, even if it’s not inside a radius of 5.
Keep in mind that every sentry is an amor stand as has the name “sentry” on it.
code_language.skript:
every 0.5 second in "world":
loop all armor stands in "world":
if name of loop-entity-1 is "sentry":
loop all pigs in radius 5 of loop-entity-1:
damage loop-entity-2 by 1 heart
loop all players in "world":
console command "/jukebox sound %loop-player% sound.mp3"
stop loop
Last edited: