for i = 1,10 do
local Sam = script.Sample:clone()
Sam.Name = i
Sam.Parent = script.Parent.SurfaceGui.Frame.ScrollingFrame
Sam.UserPos.Text = "[".. tostring(i) .. "]"
Sam.Money.Text = "Nil"
Sam.UserName.Text = ""
Sam.Layoutorder = i
script.Parent.SurfaceGui.Frame.ScrollingFrame.CanvasSize = UDim2.new(0,0,0,50*i)
end
function UpdateGui()
for i,v in pairs(game.Players:GetChilderen()) do
local Data = 1
local DateStore = game:GetService("DataStoreService"):GetOrderDataStore("MoneyX1")
DateStore:SetAsync(v.UserId,Data)
end
local DateStore = game:GetService("DataStoreService"):GetOrderDataStore("MoneyX1")
local Pages = DateStore:GetSortedAsync(false,10)
local Data = Pages:GetCurrentPage()
for k,v in pairs(Data) do
if tonumber(v.key) >= 1 then
local Frame = script.Parent.SurfaceGui.Frame.ScrollingFrame:FindFirstChild(tostring(k))
if Frame then
Frame.UserName.Text = game.Players:GetNameFromUserIdAsync(v.key)
Frame.Money.Text = tostring(v.Value)
end
end
end
end
while true do
UpdateGui()
wait(2)
end
dis needs to be a leaderboard so what did i do wrong in this script my Value is Money
Could you try trowing in a bunch of print statements and tell me which of them print? Also, you’re trying to get data about top 10 players waay faster than the limits are, instead of 2 seconds, try calling the function each 60+ seconds.
Yeah, there are a bunch of spelling mistakes through the script, open your output and either show me the errors or go through them and make sure everything’s spellec correctly
There’s “Game Settings” button with a blue gear icon under the Home tab in roblox studio. Once you click it a window should appear - on the left side, there should be a button called Options.