I'm trying to make a saving system but it won't save. I keep on getting this error: "SetAsync is not a valid member of IntValue"
Server Script (ServerScriptService)
--Varibles
local DataStore = game:GetService("DataStoreService")
local DataStoreoofs = DataStore:GetDataStore("SaveSystemoofs")
local DataStorerank = DataStore:GetDataStore("SaveSystemrank")
game.Players.PlayerAdded:Connect(function(player)
--Create Leaderstats
local LeaderStats = Instance.new("Folder", player)
LeaderStats.Name = "leaderstats"
--Create Values
local oofs = Instance.new("IntValue", LeaderStats)
oofs.Name = "OOFS"
local rank = Instance.new("IntValue", LeaderStats)
rank.Name = "RANK"
--Quick Saves
oofs.Value = DataStoreoofs:GetAsync(player.UserId) or 0
oofs:SetAsync(player.UserId, oofs.Value)
rank.Value = DataStorerank:GetAsync(player.UserId) or 0
rank:SetAsync(player.UserId, rank.Value)
--Values changed (save)
oofs.Changed:Connect(function()
DataStoreoofs:SetAsync(player.UserId, oofs.Value)
end)
rank.Changed:Connect(function()
DataStorerank:SetAsync(player.UserId, rank.Value)
end)
end)

1 comment
On line 18 and 21 you are attempting to SetAsync on IntValues. Perhaps you meant to SetAsync to DataStoreoofs and DataStorerank, in which case this is a simple error in writing.