thanks man but can you help me it says this on output
"Argument 1 missing or nil"
this is the script and all the games in the universe use the same 'helloworld' datastore
data = game:GetService('DataStoreService'):GetDataStore('helloworld')
game.Players.PlayerAdded:connect(function(p)
local hidden = Instance.new("Model", p)
hidden.Name = "hiddenstats"
local Team = Instance.new('StringValue', hidden)
Team.Name = "Team"
if data:GetAsync(key) ~= nil then
Team.Value = data:GetAsync(key)[1]
end
end)
game.Players.PlayerRemoving:connect(function(p)
key = 'usertest_'..p.userId
local save = {p.hiddenstats.Team.Value}
data:SetAsync(key, save)
end) |