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

Gui Leaderboard Question?

Asked by 10 years ago

So i recently been getting help from a few people on Roblox to create a custom leaderboard gui, here's what i got so far.

plr = game.Players.LocalPlayer
plrgui = plr.PlayerGui
username = plr.Name
for _, player in pairs(game.Players:GetPlayers()) do
    if plr.Name then
        newplr = Instance.new("TextLabel", plrgui.Leaderboard.players)
        newplr.Name = username
    while true do
        wait(2)
        newplr.Text = username
        newplr.Position = UDim2.new (0,0, 0,0)
        newplr.Size = UDim2.new (0, 100,0, 50)
        end
    end
end

Now i need to make the functions GLOBAL so that it updates for everyone, but i need it to move the text label below the current one, like lets say +10, Now if anyone could help that be nice!

Thanks?

1 answer

Log in to vote
0
Answered by
war8989 35
9 years ago

You would want to create a server-side script that would search all players' leaderboard guis and update them, such as this:

_G["UpdateLeaderboards"] = function()
    -- Iterate through each player, search for leaderboard, and apply updates.
end

Change "UpdateLeaderboards" to any function name you want. Make sure to place the function inside of a regular script though. That function can be called anywhere in a server-side script, but not in a LocalScript since it's on the server environment.

Ad

Answer this question