I was trying to save data for a minigame and I get an error. Can anyone fix it? Thanks.
local DataStoreService = game:GetService("DataStoreService") local experienceStore = DataStoreService:GetDataStore("MinigamePoints") game.Players.PlayerAdded:Connect(function(plr) local coins = Instance.new("IntValue",plr) coins.Name = "Coins" local key = "id-"..plr.UserId local savedcoins = experienceStore:GetAsync(key) if savedcoins then coins = savedcoins[1] else local coinssaving = {coins.Value} experienceStore:SetAsync(key,coins) end end) game.Players.PlayerRemoving:Connect(function(plr) local key = "id-"..plr.UserId local save = {plr.Coins.Value} experienceStore:SetAsync(key,save) end)