Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can I make end game ranking system?

How can I make end game ranking? When player(s) finishes they order 1st, 2nd and 3rd place. (Only 3 winners) That's a minigames game. And how to visualize them on ScreenGUI That's my main script:

local s = script.Stat
local vals = game.ReplicatedStorage.vals
t = 0
while true do
	t = 15
	repeat
		t = t-1
		s.Value = "Intermission.. "..t
		wait(1)
	until t == 0
	s.Value = "Game starting!"
	wait(2)
	local mapselect = game.ReplicatedStorage.Games:GetChildren()
	local choose = math.random(1,#mapselect)
	curnum = 0
	for i =1,#mapselect do
		curnum = curnum +1
		if curnum == choose then
			s.Value = "Loading map..."
			mapselect[i]:Clone().Parent = workspace
			curmap = mapselect[i].Name
			wait(1)
			s.Value = "Loading Values..."
			wait(1)
			s.Value = "Loading Characters..."
			wait(0.5)
			s.Value = "We'll be playing "..mapselect[i].Name
			
		end
	end
	wait(3)
	local plrs = game.Players:GetChildren()
	for i = 1,#plrs do
		local num = math.random(1,32)
		plrs[i].CameraMaxZoomDistance = 6
		plrs[i].Character.Head.CFrame = CFrame.new(workspace.Teleports["Part"..num].Position)
		plrs[i].Character.Parent = workspace.Ingame
		
	end
	t= 240
	repeat
		t = t-1
		s.Value = t.." seconds left"
		wait(1)
	until t ==0 or vals.Winner.Value ~= "" or #game.Workspace.Ingame:GetChildren() == 0
	if vals.Winner.Value ~= "" then
		s.Value = vals.Winner.Value.. " has won!"
		game.Players[vals.Winner.Value].leaderstats.Points.Value =game.Players[vals.Winner.Value].leaderstats.Points.Value +50
		game.Players[vals.Winner.Value].leaderstats.Wins.Value = 	game.Players[vals.Winner.Value].leaderstats.Wins.Value +1
		vals.Winner.Value = ""
	else
		s.Value = "No one has won!"
	end
	wait(3)
	local ingame = workspace.Ingame:GetChildren()
	for i =1,#ingame do
		local plr = game.Players:GetPlayerFromCharacter(ingame[i])
		plrs[i].CameraMaxZoomDistance = 20
		plr:LoadCharacter()
		
	end
	workspace[curmap]:Destroy()
end

Any help would be appreciated! :)

1 answer

What's the point of this? Are you trying to torture your players?

            curmap = mapselect[i].Name
            wait(1)
            s.Value = "Loading Values..."
            wait(1)
            s.Value = "Loading Characters..."
            wait(0.5)
            s.Value = "We'll be playing "..mapselect[i].Name

Anyways, you want to make a table for the winners something like this:

local winners = {}
winners[1] = firstWinner

https://developer.roblox.com/en-us/articles/Table

This discussion is preserved as it was. New answers, comments, and votes are closed.