I can not store multiple data

my code:
local DataStoreService = game:GetService(“DataStoreService”)

local playerData = DataStoreService:GetDataStore(“PlayerData”)

game.Players.PlayerAdded:Connect(function(player)-- When a player joins the game
local leaderstats = Instance.new(“Folder”, player)-- Inserting a Folder named Leaderstats
leaderstats.Name = “leaderstats” – Name of the folder
local cash= Instance.new(“NumberValue”,leaderstats)
cash.Name=“cash”
local level= Instance.new(“NumberValue”,leaderstats)
level.Name=“level”
local data

local success, err = pcall(function()
	data = playerData:GetAsync("playerdata_"..player.UserId)
	
end)

if success then
	print("success")
	if data then
		print("data")
		cash.Value=data[1]
		level.Value=data[2]
	else
		cash.Value=0
		
	end
else
	warn(err)
	end

end)
game.Players.PlayerRemoving:Connect(function(player)
local leaderstats = player.leaderstats
local cash = leaderstats.cash
local level=leaderstats.level
local data = {cash.Value,level.Value}
local success, err = pcall(function()
playerData:SetAsync(“playerdata_”…player.UserId, data)
end)

if success then
	print("data saved")

else
	warn(err)
end

end)

You can save multiple values to a data-store with tables, or arrays. You can’t store tables in a value object, so you’ll have to store this information within a script.

Put this post in Scripting Support since the is script error.

what do you mean can you fix my script?

What would you learn from that? Figure it out, you can try learning to script other things to gain a better understanding about code.