I have this code:
local datastore = game:GetService("DataStoreService"):GetDataStore("Statistics")
game.Players.PlayerAdded:connect(function(player)
local async = datastore:GetAsync(tostring(player.userId))
local cash,xp = Instance.new("IntValue",player),Instance.new("IntValue",player)
cash.Name = "Cash"
xp.Name = "XP"
cash.Value = async[1] --breaks here
xp.Value = async[2]
print(cash.Value,xp.Value)
end)
It breaks at where i said and outputs something like: async, a nil value How and why does it do this?
