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

Can someone help me with this leaderboard updater?

Asked by
sad_eyez 162
7 years ago
Edited 7 years ago

I am trying to make an updated for my custom player list and i think i need some help updating the money and rap, heres my error and my code:

Error: there is no error anywhere

while wait() do
    local plr = game.Players.LocalPlayer
    local stats = plr:WaitForChild("Stats")
    local money = stats:WaitForChild("Money")
    script.Parent.Text = "$"..money.Value
    local allplayers = game.Players:GetPlayers()
    for i,v in pairs(allplayers) do
        if v.Name == "PlayerGui" then
            for i,k in pairs(v:GetChildren()) do
                if k.Name == "CustomPlayerList" then
                    local holder = k:WaitForChild("Holder")
                    for i,l in pairs(holder:getChildren()) do
                        if l.Name == plr.Name then
                            local moneytext = l:WaitForChild("Money")
                            moneytext.Text = "$"..money.Value
                        end
                    end
                end
            end
        end
    end
end
0
Are you sure the GUI is named Holder? The error shows that there is no item named Holder in CustomPlayerList.main, so maybe try replacing like 06 with "v.PlayerGui:WaitForChild("CustomPlayerList"):WaitForChild("main")" joritochip 705 — 7y
0
What deranged said was right, Infinite Yield means can't find. It can't find Holder. Try redoing the variable line BlackOrange3343 2676 — 7y
0
i updated the script, But i am having a different error now sad_eyez 162 — 7y
0
Post the error, then... joritochip 705 — 7y
0
I updated it with a different method i am trying, this time there is no error, it just won't work in test mode, but works in studio, is it an issue with getting the children within all the players? sad_eyez 162 — 7y

Answer this question