so i have a script for a global leaderboard script which works in studio just fine but when i publish the game and play it, the leaderboard just sends me an error.
the script:
local Leader1 = game:GetService("DataStoreService"):GetOrderedDataStore("XPs")
local function Handler()
local Success, Err = pcall(function()
local Data1 = Leader1:GetSortedAsync(false, 15)
local PrestigePage1 = Data1:GetCurrentPage()
for Rank, Data in ipairs(PrestigePage1) do
local Name = Data.key
local Prestige = Data.value
local PlaceMent = game.ReplicatedStorage:WaitForChild("lbFrame"):Clone()
local playerid = game.Players:GetUserIdFromNameAsync(Name)
local player = game.Players:GetPlayerByUserId(playerid)
PlaceMent.Player.Text = Name
PlaceMent.XP.Text = Prestige
PlaceMent.Rank.Text = player:WaitForChild("leaderstats").Rank.Value
PlaceMent.Place.Text = "#"..Rank
PlaceMent.Position = UDim2.new(0, 0, PlaceMent.Position.Y.Scale + (0.08 * #game.Workspace.GlobalLeaderboard.lbGUI.Holder:GetChildren()), 0)
PlaceMent.Parent = game.Workspace.GlobalLeaderboard.lbGUI.Holder
end
end)
if not Success then
error(Err)
end
end
while true do
for _,Player in pairs(game.Players:GetPlayers()) do
Leader1:SetAsync(Player.Name, Player.leaderstats.XP.Value)
end
for _,v in pairs(game.Workspace.GlobalLeaderboard.lbGUI.Holder:GetChildren()) do
if v.Name == "lbFrame" then
v:Destroy()
end
end
Handler()
wait(20)
end
the error im getting is:
serverscriptservice.Globalleaderboardscript1:15: attempt to index nil with 'WaitForChild'
i know this has something to do with roblox properties but im not sure how to fix it.

7 comments
You should upload the error image into an image hosting service. You are attempting to link to a local file which we cannot access (only if we were on your computer).
sorry i knew that wouldnt work. can you access the image from the link i pasted?
cant get access to the photo. is there like a sharing settings u can change on the photo, or can you post what the error says?
yea im just ganna post what teh error says this link stuff is annoying, not wokring
not sure, but i think 1bFrame doesnt exist/ isnt a child of of replicated storage, if u know what that means
sorry, not 1bFrame, leaderstats
leaderstats exist but for some reason i cant get it