How would I go about adding a 1st, 2nd, and 3rd place system to this battle royale game I’m working on. The idea is that if a player gets killed then it will display a GUI that states what number they placed and the last person left will have a different GUI that says they won the game.
If I were in charge of this idea here’s what I’d do:
-
When the game starts, store all the players in a table
-
When a player dies, remove them from the table and get the length of the table (
#table
) and then display it on a GUI -
When a player wins (only 1 player in the table) then prompt them their win GUI (you could check how many players in the table every
[interval]
seconds)
This is pretty basic, and is just a little outline on what you could do.
You could have two folders in workspace, Alive, and Dead, then when I person dies set their character’s parent to the “Dead” folder. To see what you place when you die you can just do a check like this
Placement = #Alive:GetChildren() -- Gets the number of players in the alive folder
So in theory, lets say you have 15 people in the alive folder, 5 in the dead folder, then you die, before you get put into the dead folder it checks your placement and shows your number 15.
and for when the player wins, just have a function like this
Alive.ChildRemoved:Connect(function()
if #Alive:GetChildren() == 1 then
Winner = Alive:FindFirstChildWhichIsA("Model")
-- Winner code
end
end)
Something like that.
I’m not sure which of our methods is more efficient. However, I’m pretty sure BOTH methods work; it’s jsut preference.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.