Facebook
From olimaly, 1 Year ago, written in Lua.
Embed
Download Paste or View Raw
Hits: 3320
  1. local MoneyStore = game:GetService("DataStoreService"):GetDataStore("MoneyData")
  2. local RebirthStore = game:GetService("DataStoreService"):GetDataStore("RebirthData")
  3. local EyeStore = game:GetService("DataStoreService"):GetDataStore("EyesData")
  4.  
  5.  
  6. game.Players.PlayerAdded:Connect(function(plr)
  7.         local leaderstats = Instance.new("Folder")
  8.         leaderstats.Name = "leaderstats"
  9.         leaderstats.Parent = plr
  10.  
  11.         local money = Instance.new("IntValue")
  12.         money.Name = "Coins"
  13.         money.Value = MoneyStore:GetAsync(plr.UserId) or 0
  14.         money.Parent = leaderstats
  15.         local Rebirths = Instance.new("IntValue")
  16.     Rebirths.Name = "Rebirths"
  17.         Rebirths.Value = RebirthStore:GetAsync(plr.UserId) or 0
  18.         Rebirths.Parent = leaderstats
  19.         local Eyes = Instance.new("IntValue")
  20.         Eyes.Name = "Eyes"
  21.         Eyes.Value = EyeStore:GetAsync(plr.UserId) or 0
  22.         Eyes.Parent = leaderstats
  23.  
  24.  
  25. end)
  26.  
  27. game.Players.PlayerRemoving:Connect(function(plr)
  28.  
  29.         MoneyStore:SetAsync(plr.UserId, plr.leaderstats.Coins.Value)
  30.         RebirthStore:SetAsync(plr.UserId, plr.leaderstats.Rebirths.Value)
  31.         EyeStore:SetAsync(plr.UserId, plr.leaderstats.Eyes.Value)
  32. end)

Replies to leaderstats rss

Title Name Language When
Re: leaderstats Gray Cockroach lua 1 Month ago.
Re: leaderstats Blush Parakeet lua 3 Months ago.
Re: leaderstats Innocent Curlew lua 8 Months ago.
Re: leaderstats Round Penguin lua 8 Months ago.
Re: leaderstats Patryk Pr lua 9 Months ago.
Re: leaderstats Mature Tortoise lua 10 Months ago.
Re: leaderstats Sweltering Moth lua 11 Months ago.
Re: leaderstats Colorant Gorilla lua 1 Year ago.
Re: leaderstats Trivial Macaque lua 1 Year ago.
Re: leaderstats Cream Sloth lua 1 Year ago.
Re: leaderstats Melodic Hog lua 1 Year ago.
Re: leaderstats julka_kot1 go 1 Year ago.
Re: leaderstats bartek lua 1 Year ago.
Re: leaderstats Queen Bird lua 1 Year ago.
Re: leaderstats Sloppy Bee lua 1 Year ago.
Re: leaderstats Little Sloth lua 1 Year ago.
Re: leaderstats hd admin lua 1 Year ago.
Re: leaderstats Silly Parrot lua 1 Year ago.
Re: leaderstats Corrupt Bat lua 1 Year ago.
Re: leaderstats Lousy Cat lua 1 Year ago.
Re: leaderstats Bitty Bird lua 1 Year ago.
Re: leaderstats Chartreuse Eider lua 1 Year ago.