Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

[Please help] How would I make a server leaderboard?

Asked by 3 years ago
Edited 3 years ago

Hi, so when I asked a server leaderboard, I mean a real custom leaderboard like in phantom forces where it tells you your leaderstats. I also want the person with the most stats to be on top, but for some reason, when I add a player to the leaderboard it does not show to the other players.

local Players = game:GetService("Players")

local Template = game:GetService("ReplicatedStorage").Template

Players.PlayerAdded:Connect(function(Plr)   

    local newTemplate = Template:Clone()
    newTemplate.Name = Plr.Name
    for i,v in pairs(Players:GetChildren()) do
            if v:FindFirstChild("PlayerGui") then
                if v.PlayerGui:WaitForChild("Leaderboard") then
                    if v.PlayerGui.Leaderboard:WaitForChild("Holder") then
                        if v.PlayerGui.Leaderboard.Holder:WaitForChild("Platform") then
                            newTemplate.Parent = v.PlayerGui.Leaderboard.Holder.Platform
                        end
                    end
                end
            end
    end
    newTemplate.PName.Text = Plr.Name
end)

Players.PlayerRemoving:Connect(function(Plr)
    local server = Players:GetChildren()
    for i,v in pairs(Players:GetChildren()) do
            if v:WaitForChild("PlayerGui") then
                if v.PlayerGui:WaitForChild("Leaderboard") then
                    if v.PlayerGui.Leaderboard:WaitForChild("Holder") then
                        if v.PlayerGui.Leaderboard.Holder:WaitForChild("Platform") then
                            for _,e in pairs(v.PlayerGui.Leaderboard.Holder.Platform:GetChildren()) do
                                if e.Name == Plr.Name then
                                    e:Destroy()
                                end
                            end
                    end
                end
            end
        end
    end
end)
0
Please post your code or something like that. yx10055 57 — 3y
0
i did ScentedTrashCan 16 — 3y
0
What you're asking for requires GUI knowledge. Though there are some UI libraries than can help you with this. ROACT can help with this as it is used in Whatever Floats Your Boat (it's the only game I know that uses this) and it seems among the most popular library. Give that a try. CMVProduction 25 — 3y
0
I can't really help you... I need the game file but you probably don't want people to see it so I can't help you. yx10055 57 — 3y

Answer this question