local DataStore = game:GetService("DataStoreService")
local PointsData = DataStore:GetDataStore("PointsData")

game.Players.PlayerAdded:Connect(function(plr)
	local Points = Instance.new("NumberValue",plr)
	Points.Name = "Points"
	local Data
	
	local success, message = pcall(function()
		Data = PointsData:GcetAsync(plr.UserId.."-Points")
		plr.Points.Value = Data
	end)
	
	if success then
		print("Success")
	else
		warn("Error Whilst loading. Error message: "..message)
	end
end)

game.Players.PlayerRemoving:Connect(function(plr)
	local success, message = pcall(function()
		PointsData:SetAsync(plr.UserId.."-Points", plr.Points.Value)
	end)
	

	if success then
		print("Success")
	else
		warn("Error Whilst saving. Error message: "..message)
	end
end)

2 comments

0

Yes, you put gcetAsync instead of getasync.

0

10th line. you've been put GcetAsync instead GetAsync.