Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local player = game.Player.PlayersAdded:Connect(function(Players)
- local leaderstats = Instance.new("Folder")
- local leaderstats = Instance.new("CurrencyName")
- leaderstats.Name = 'leaderstats'
- leaderstats.Parent = Player
- local Clicks = Instance.new("CurrencyName")
- Clicks.Name = Clicks
- Clicks.Parent = Player
- Clicks.Value = 0
- end)
- game.PlayerOnRemoving = game.Player.PlayerOnRemoving:GetService(function(DataStore)
- local DS = Game.PlayerOnRemoving:GetAsync(UserId, CurrencyId)
- if DS == Id then
- local DataStore = game.DataStore:GetService("PlayerOnRemoving, PlayerId, UserId")
- print("Player Removed From Game And Sucessfully Saved Data")
- if not Player == DS then
- game.Player.OnRemoving = game:GetService()
- print("Unsucessfully Saved Data")
- coins.Table = for _ in next i,v(Table.Async.Data[#1])
- Currnecy.Name = "Coins" --change the currency value name to any currency you want--
- end
- end)
Advertisement
Advertisement