2

Need /Execute If Help

NemisisNaxus911 3/1/20 10:57 pm
179
3/3/2020 4:12 am
So I'm creating a Murder Mystery game mode for my server, and I really need some help with one minor part of the command block code.

When players accuse another player, I have it set up so that it detects if the killer is on the "killer" team and has a certain "player number" score, then the player who accuses the killer will win. Is there a way to detect if the player on the killer team has the precise player number score? I know that @e selects all entities and @a selects all players and @p selects the nearest player, but is it possible to have it select if ANY one player has exactly the two values I need?

Thanks in advance, I've been stuck with this for a while now. The code I have works pretty well, but only about 95% of the time.
Posted by
NemisisNaxus911
Level 9 : Apprentice Miner
8

  Have something to say?

JoinSign in

4

Isz
03/02/2020 4:56 pm
Level 48 : Master Architect
Post the exact command you're using?
2
HoboMaggot
03/02/2020 3:41 am
Level 55 : Grandmaster Blob
/execute if entity @a[team=killer,scores={player_score=#}] run <command>
3
NemisisNaxus911
03/02/2020 4:39 pm
Level 9 : Apprentice Miner
That's pretty much exactly what I'm using, but for some reason it doesn't seem to work 100% of the time, even though everything else seems to be perfect. Is there maybe something I'm missing?
2
HoboMaggot
03/03/2020 4:12 am
Level 55 : Grandmaster Blob
Maybe
/execute as @a[team=killer,scores={player_score=#}] run <command>This is usually used for more than 1 entity/player, but it still works. If you have multiple murderers and you want only 1, put a limit=1 at the end of the selector
1

Welcome