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

My leaderboard does not display player to everyone?

Asked by 3 years ago

Hi, I am making a leaderboard, kind of like phantom forces. Everything works flawlessly, but there's one thing that is wrong. Whenever the script clones the template, it only shows the local player, not the whole server. What am I doing wrong?

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:IsA("Player") then
            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
                            newTemplate.Parent = v.PlayerGui.Leaderboard.Holder.Platform
                        end
                    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:IsA("Player") then
            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
end)

This is a script inside serverscriptservice. Please help

0
you guys are no help ScentedTrashCan 16 — 2y

Answer this question