Hello, I am trying to save models, but it doesn’t save because it states this following error: DataStoreService: CantStoreValue: Cannot store in data store. Data stores can only accept valid UTF-8 characters. API: UpdateAsync, Data Store: Dev10
Here’s the code:
local MPS = game:GetService("MarketplaceService")
local RS = game:GetService("ReplicatedStorage")
local Remotes = RS.Remotes
local Manager = {}
Manager.Profiles = {}
function Manager.AdjustRoks(player: Player, amount: number)
local profiles = Manager.Profiles[player]
if not profiles then return end
profiles.Data.Roks += amount
player.leaderstats.Roks.Value = profiles.Data.Roks
end
function Manager.SaveRoks(player: Player, ore: Model, destroyed: boolean) -- This is save code
local Profiles = Manager.Profiles[player]
if not Profiles then return end
local OreTable = Profiles.Data.Ores
if destroyed then
table.remove(OreTable, table.find(OreTable, ore))
else
table.insert(OreTable, ore)
end
print(OreTable)
end
return Manager
Here’s the Template if you need it:
local module = {
Roks = 0,
RoksMP = 1,
Luck = 0,
Ores = {}
}
return module