How to make a Winners System?

Hello! Im Nik, a new Developer.

I have a game i’m currently working on, but it has a problem.
It’s a Spleef game (like Tower Of Spleef).

The problem is that when the timer ends and there are still players on the playing team, a GUI shows the Winners name, like: “Winners: -player1-, -player2-,…”

Why i am asking you guys this, is that i have no clue how to make such thing.

Could someone help me out with this problem?

Note: *The game isn’t about the first player to finish, it’s about the players who are still in round/in the playing team, those are the Winners.

Thanks!

Well you can use actual Roblox teams, then when a round starts set everyone back to the In-Game team, once a player finishes the game set his team to the Winners team. Then once the whole game is done make a loop to get every player in the Winners team and display them on your gui!

Roblox Dev Hub - Teams

2 Likes

When a new round starts, it sets everyone to the “Playing” team.
Also, this game isn’t about someone finishing it first. It has a 60 seconds timer for you to stay alive during it.
When the timer hits 0, it gets all of the players who are still alive, in the “Playing” team.

Maybe you could play “Tower Of Spleef” and see what i mean.

Thanks for replying!

Ok I get it now so basically, same concept.

*Round starts - Everyone gets set to a the Playing team

*Player dies, remove them from the playing team and add them to a spectators team or smth like that

*Round ends, loop through everyone still on the players team and add them to the gui that displays the winners

1 Like

YES! That’s exactly what i am searching for. Altough i have no clue how to make that.

Ok so first things first do you already have your teams added?

Yes i have. They are called “Playing” and “Lobby”.

Okay, do you already have the round system going?

Yes i have. I can’t send the code right now, so dont respond. I will send you the code and stuff when i have the chance, since i currently dont have time. Is that ok for you?

Sure, I’ll be waiting for the code, also once you send it feel free to message me so I get a notification and go check.

1 Like

Since you are utilizing the Teams service, you won’t need much server communication unless you were to utilize a coded table system. (Like Winners={})

Nevertheless, on a client local script, use a PropertyChangedSignal(“Value”) (assuming you display a string value timer) and if the value is == end condition like “0 seconds remaining” the for i, v in pairs(playingteam:GetPlayers()) and you will need to construct UI where you can display the winners

ex: A text label

within the mentioned forloop:

Winners.Text= Winners.Text … " " v.Name

1 Like

If it is a value then GetPropertyChangedSignal("Value") can lead reduced to simply `valueObj.Changed

The precise methodology to this would be having a listener function, check winner function and a Gui to Display the names of the players on.

First things first would be to set up a listener to only trigger upon the games end, this can only be created by you as you know the specifics to your game and how it’s meant to be played; on the event that the listener is triggered you will want to:

A) Use a remote event to FireAllClients, then change the Gui text with very basic string manipulation using your check winner function.

B) Loop through all the current player’s in the server and the set the string in their specific playergui to the text you want using very minor and easy string manipulation again with your check winner function.

Notes:

The listener function should preferably be a call-back connected to :GetPropertyChangedSignal().

The check winner function you should attempt to incorporate ‘Teams’ Service however that is not required, you can separate player teams with two distinct tables.

1 Like