Advertisement
Guest User

a

a guest
Nov 14th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.27 KB | None | 0 0
  1. local TotalWheatODS = game:GetService("DataStoreService"):GetOrderedDataStore("Total Score")
  2. local function Handler()
  3.     local Success, Err = pcall(function()
  4.         local Data = TotalWheatODS:GetStoredAsync(false, 25)    
  5.         local TotalScore = Data:GetCurrentPage()
  6.         local TotalWheatPage
  7.         for Rank, Data in ipairs(TotalWheatPage) do
  8.             local Name = Data.key
  9.             local Score = Data.Value
  10.             local newObj = game.ReplicatedStorage:WaitForChild("IbFrame"):Clone()
  11.             newObj.Player.Text = Name
  12.             newObj.Score.Text = Score
  13.             newObj.Rank.Text = "#"..Rank
  14.             newObj.Position = UDim2.new(0,0,newObj.Position.Y.Scale + (0.08 * #game.Workspace.StartCoinBoard.lbGUI.Holder:GetChildren()),0)
  15.             newObj.Parent = game.Workspace.StartCoinBoard.lbGUI.Holder
  16.         end
  17.     end)
  18.     if not Success then
  19.         error(Err)
  20.     end
  21. end
  22.  
  23. while true do
  24.     for _,Player in pairs(game.Players:GetPlayers()) do
  25.         TotalWheatODS:SetAsync(Player.Name, Player.leaderstats.Coins.Value)
  26.     end
  27.     for _,v in pairs(game.Workspace.StatCoinBoard.lbGUI.Holder:GetChildren()) do
  28.         if v.Name == "lbFrame" then
  29.             wait()
  30.         v:Destroy()
  31.          end
  32.     end
  33.     Handler()
  34.     wait(10)
  35. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement