So its not saving this stuff and I need some help fixing it. If someone could please fix this I would jump in joy :)
local DSS = game:GetService('DataStoreService'):GetDataStore('Credits')
local Sp = game:GetService('DataStoreService'):GetDataStore('Speed')
function save(plr, value)
DSS:UpdateAsync(plr.userId, function(Data)
Sp:UpdateAsync(plr.userId, function(Datas)
return value
end)
end)
end
function loads(plr)
return Sp:GetAsync(plr.userId) or Sp:SetAsync(plr.userId, 0) and 0
end
function load(plr)
return DSS:GetAsync(plr.userId) or DSS:SetAsync(plr.userId, 0) and 0
end
game.Players.PlayerAdded:connect(function(plr)
local points = Instance.new('IntValue', plr)
points.Name = 'Credits'
points.Value = load(plr)
local speed = Instance.new('IntValue', plr)
speed.Name = "Speed"
speed.Value = loads(plr)
plr.PlayerGui.Menu.Credits.Text = "Credits: "..plr:FindFirstChild("Credits").Value
points.Changed:connect(function()
plr.PlayerGui.Menu.Credits.Text = "Credits: "..plr:FindFirstChild("Credits").Value
end)
end)
game.Players.PlayerRemoving:connect(function(plr)
save(plr, plr.Credits.Value)
save(plr, plr.Speed.Value)
end)
