Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local TotalWheatODS = game:GetService("DataStoreService"):GetOrderedDataStore("Total Score")
- local function Handler()
- local Success, Err = pcall(function()
- local Data = TotalWheatODS:GetStoredAsync(false, 25)
- local TotalScore = Data:GetCurrentPage()
- local TotalWheatPage
- for Rank, Data in ipairs(TotalWheatPage) do
- local Name = Data.key
- local Score = Data.Value
- local newObj = game.ReplicatedStorage:WaitForChild("IbFrame"):Clone()
- newObj.Player.Text = Name
- newObj.Score.Text = Score
- newObj.Rank.Text = "#"..Rank
- newObj.Position = UDim2.new(0,0,newObj.Position.Y.Scale + (0.08 * #game.Workspace.StartCoinBoard.lbGUI.Holder:GetChildren()),0)
- newObj.Parent = game.Workspace.StartCoinBoard.lbGUI.Holder
- end
- end)
- if not Success then
- error(Err)
- end
- end
- while true do
- for _,Player in pairs(game.Players:GetPlayers()) do
- TotalWheatODS:SetAsync(Player.Name, Player.leaderstats.Coins.Value)
- end
- for _,v in pairs(game.Workspace.StatCoinBoard.lbGUI.Holder:GetChildren()) do
- if v.Name == "lbFrame" then
- wait()
- v:Destroy()
- end
- end
- Handler()
- wait(10)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement