I am making a "murder mystery" gamemode in minecraft, and I've bumped into a problem,
I'm not going to explain the rules of the game, since there are a lot and it is pretty confusing. Instead, I'll sum it up for you:
A player chooses to summon 2-4 other players to check if they are impostors or not. After he chooses which players he wants to summon, everyone gets "Accept" and "Refuse" wools, which allows them to vote whether they approve of his choice or not. I made it so once you throw one of the wools, it dissapears from the ground and so does the other one (from your invenrory), but I need to check whether there were more "Accept" or "Refuse"...
I want to do that with a scoreboard, but I don't really know how. What I want to do is for a scoreboard to register all the votes (there are a total of 6, so 4 votes win and if there is a tie than "Refuse" wins), and then compare the votes and see which one wins. After it decides which one wins, it will tp the players chosen to a room.
I'm OK with command blocks, but not amazing, so I'd appreciate simplification of things... XD
Now this command on repeat will detect when everyone votes:
execute if score $total votes matches 6 run …
The command after run should somehow activate the following script to check for a winner:
execute if score $approve votes > $reject votes run tellraw @a "proposal of interrogation has been approved of"
execute if score $reject votes > $approve votes run tellraw @a "proposal of interrogation has been rejected"
execute if score $approve votes = $reject votes run tellraw @a "it's a tie"
Rollback Post to RevisionRollBack
This forum has somewhat of a workaround for inline code formatting, but it still uses BBCode, which kinda sucks.
/execute if score $total votes matches 6 run setblock X Y Z redstone_block
And have the redstone block connect to 3 command blocks each consisting the commands:
/execute if score $approve votes > $reject votes run tellraw @a "proposal of interrogation has been approved of"
/execute if score $reject votes > $approve votes run tellraw @a "proposal of interrogation has been rejected"
/execute if score $approve votes = $reject votes run tellraw @a "it's a tie"
And so only one of these would activate?
Also, you can't do scoreboard players add...
you have to do scoreboard players @a/@p/name of player...
Hello everone!
I am making a "murder mystery" gamemode in minecraft, and I've bumped into a problem,
I'm not going to explain the rules of the game, since there are a lot and it is pretty confusing. Instead, I'll sum it up for you:
A player chooses to summon 2-4 other players to check if they are impostors or not. After he chooses which players he wants to summon, everyone gets "Accept" and "Refuse" wools, which allows them to vote whether they approve of his choice or not. I made it so once you throw one of the wools, it dissapears from the ground and so does the other one (from your invenrory), but I need to check whether there were more "Accept" or "Refuse"...
I want to do that with a scoreboard, but I don't really know how. What I want to do is for a scoreboard to register all the votes (there are a total of 6, so 4 votes win and if there is a tie than "Refuse" wins), and then compare the votes and see which one wins. After it decides which one wins, it will tp the players chosen to a room.
I'm OK with command blocks, but not amazing, so I'd appreciate simplification of things... XD
Thanks in advance to anyone who helps
Add a new scoreboard to count votes:
Now set up three fake players to track approvals and rejection votes:
When someone chooses the green Approve wool, run these commands which will add one to both the Approve and Total scores:
Do the same with $reject for the rejection votes.
Now this command on repeat will detect when everyone votes:
The command after run should somehow activate the following script to check for a winner:
This forum has somewhat of a workaround for inline code formatting, but it still uses BBCode, which kinda sucks.
Wow! Thank you so much!
So can I do this:
/execute if score $total votes matches 6 run setblock X Y Z redstone_block
And have the redstone block connect to 3 command blocks each consisting the commands:
/execute if score $approve votes > $reject votes run tellraw @a "proposal of interrogation has been approved of"
/execute if score $reject votes > $approve votes run tellraw @a "proposal of interrogation has been rejected"
/execute if score $approve votes = $reject votes run tellraw @a "it's a tie"
And so only one of these would activate?
Also, you can't do scoreboard players add...
you have to do scoreboard players @a/@p/name of player...