|
| 16 Jan 2016 06:35 PM |
Why doesn't this crap work..... ._.
ds = game:GetService("DataStoreService"):GetDataStore("VirtualCurrency")
game.Players.PlayerAdded:connect(function(player) local leaderstats = Instance.new("IntValue", player) leaderstats.Name = "leaderstats" local vc = Instance.new('IntValue', player) vc.Name = 'VC' vc.Value = ds:GetAsync(player.Name) or 0 end)
game.Players.PlayerRemoving:connect(function(player) ds:UpdateAsync(player.Name, function(oldValue) return player.leaderstats.VC.Value end) end)
game.OnClose = function() for i, v in pairs(game.Players:GetChildren()) do ds:UpdateAsync(v.Name, function(oldValue) return v.leaderstats.VC.Value end) end wait(1) end
|
|
|
| Report Abuse |
|
hkep
|
  |
| Joined: 19 Jul 2014 |
| Total Posts: 550 |
|
|
| 16 Jan 2016 06:49 PM |
| vc is put in the player rather than leaderstats. |
|
|
| Report Abuse |
|
hkep
|
  |
| Joined: 19 Jul 2014 |
| Total Posts: 550 |
|
|
| 16 Jan 2016 06:50 PM |
Visit my thread: http://forum.roblox.com/Forum/ShowPost.aspx?PostID=181749340
|
|
|
| Report Abuse |
|