|
| 05 Dec 2014 06:29 PM |
Sorry if I got this completely wrong - very new to DataStores, been using Data Persistence for a while.
local service = game:GetService("DataStoreService") local val = game:GetService("DataStoreService"):GetDataStore("points")
game.Players.PlayerAdded:connect(function(player) local stats = Instance.new("Model", player) stats.Name = "leaderstats" local points = Instance.new("IntValue", stats) points.Name = "sup" points.Value = val:GetAsync("hello") end)
game.Players.PlayerRemoving:connect(function(player) local newpoints = player.leaderstats.sup val:SetAsync("hello", newpoints.Value) end) |
|
|
| Report Abuse |
|
|
|
| 05 Dec 2014 06:31 PM |
you would have to join, leave and join again to find value... also on player remove, i would ask if leaderstats ~= nil but that's me |
|
|
| Report Abuse |
|
|
|
| 05 Dec 2014 06:33 PM |
| Are you asking us why it doesn't work, or why it doesn't NOT work? |
|
|
| Report Abuse |
|
|
| |
|
|
| 05 Dec 2014 06:34 PM |
How could I have not known xD
Thanks. |
|
|
| Report Abuse |
|
|
| |
|