I'm attempting to make a Battle Royale type game in Fortnite. The map itself has been built. I've got the basics already coded into command blocks, like spawning and changing your game mode and what not.
The part I'm mostly having trouble with is the scoreboard, what I want is for it to display how many players are still alive in the game on the right, and when someone dies, it decreases that number by one. So for example if there's 6 in the game, the number would be "6", when one person dies, it becomes "5", but when they respawn, I want it to stay as "5", since they'll be sitting in a spectating area.
And when the number hits "1", I want it to come up on everyone's screens that "*Player Name* won!"
(Although I don't know how to program it, I'd have guessed you'd add every players name to a list? then when they die, remove them from that list? Then just have the scoreboard keep track of how many players are still on that list? I'm not sure. )
I'm rather new to Command Blocks, and with all the different information online from the Java edition of the game and what not, I've had a hard time trying to learn about the ins and outs of Command Blocks.
I'm attempting to make a Battle Royale type game in Fortnite. The map itself has been built. I've got the basics already coded into command blocks, like spawning and changing your game mode and what not.
The part I'm mostly having trouble with is the scoreboard, what I want is for it to display how many players are still alive in the game on the right, and when someone dies, it decreases that number by one. So for example if there's 6 in the game, the number would be "6", when one person dies, it becomes "5", but when they respawn, I want it to stay as "5", since they'll be sitting in a spectating area.
And when the number hits "1", I want it to come up on everyone's screens that "*Player Name* won!"
(Although I don't know how to program it, I'd have guessed you'd add every players name to a list? then when they die, remove them from that list? Then just have the scoreboard keep track of how many players are still on that list? I'm not sure. )
I'm rather new to Command Blocks, and with all the different information online from the Java edition of the game and what not, I've had a hard time trying to learn about the ins and outs of Command Blocks.
Thanks!
Im out of town so the cmd may be off but each time you spawn in a player, add to scoreboard.
/scoreboard objectives playerCount add 1
Then whereever they respawn to have it do something like
/execute @a[x=#,y=#,z=#,r=#,tag=!dead] ~~~ scoreboard objectives playerCount remove 1
Then tag the player with
/tag @a[x=#,y=#,z=#,r=#] add dead
Make sure the x, y, and z are where the players respawn to after dying