Last player left name

Using my player counter, I made it so if the host dies they get tped away. How do I make it so if there’s 1 player left the players name is stored in a property? I’ve tried making a relay to a trigger that sets the name but it doesn’t work

2 Likes

Try using one of these guides and modifying from there:

(Yes, I know you made the guide above.)

(If you’re asking about how to store the name into a property I can’t help you with that, I’m very bad with blocks.)

2 Likes

I tried moding my guide

Did it work?

no I said what I tried in the first post

Can you show me the block code?

I can’t right now, I don’t have my chromebook

1 Like

If by one player you mean one player not a spectator, you could use a trigger → relay (all) → trigger setup. In the second triggers block code, have it set the property to the triggering players block code. Hope this helped!

2 Likes

Maybeee, wire a life cycle to a knockout manager, then wire the knockout manager to a counter incremeanting it. Have the counter’s target as many people in your game minus one. Then wire the counter to another counter incremeanting it. The target doesn’t matter. Have it update a property and have the property as the property you are using. But this will only work if players don’t respawn.

2 Likes

Don’t forget to mark a solution!

1 Like

When someone dies, set their player-scoped property “Alive”, to false. Then, it checks to see if anyone else is alive using the player counter. If no one else is alive then a checker checks if “Alive” is true using an all-players relay. If that is true, then have a trigger go off that sets the triggering player’s name/ID to it.

2 Likes

Bump because I still need help

What do you still need help on?

1 Like

It doesn’t work thats what I did

Ok, so you should be able to use a counter and a team switcher, along with a ko manager. So when ko happens, and they switch team, counter goes up by one, so when that counter reaches a certain number the allowed number of players, game ends. And use this guide to help.

this is to find the last players name, I made a guide on player counter

oh, ok but the point is understood, correct?

yes, thats what I tried

Code… I know it is possible because @anonymous12 created BSB, and it ends when one player is standing. I just have to ask him.

Did you try relay (all players) → checker (item = 1) [if true] → trigger {set property: triggering players name}?

1 Like