So i started making a new game and i wanted to save my data using ProfileService. I’ve followed a tutorial by Amora. After trying to test it for the first time i got this error :
ServerScriptService.Modules.ProfileService:2209: [ProfileService]: Missing or invalid "Name" parameter -
I don’t know how to fix this. I’m pretty sure it is a problem with my DataManager script, but it also could be my Template being setup wrong as i don’t really know that much about tables yet.
My template :
local Template = {
["Fist Strenght"] = 0;
["Endurance"] = 0;
["Psychic Power"] = 0;
["Movement Speed"] = 0;
["Jump Force"] = 0;
Currencies = {
["Tokens"] = 0;
["Runes"] = 0;
};
Multipliers = {
["Fist Strenght"] = 1;
["Endurance"] = 1;
["Psychic Power"] = 1;
["Movement Speed"] = 1;
["Jump Force"] = 1;
["Tokens"] = 1;
["Runes"] = 1;
}
}
return Template
And here is my DataManager script :
local Players = game:GetService("Players")
local ServerScriptService = game:GetService("ServerScriptService")
local RunService = game:GetService("RunService")
local modules = ServerScriptService.Modules
local ProfileService = require(modules.ProfileService)
local Template = require(script.Template)
local DATA_KEY = "_Production_0"
if RunService:IsStudio() then
DATA_KEY = "_Datastore_Testing_0"
end
local profileStore = ProfileService:GetProfileStore(DATA_KEY, Template)
local DataManager = {}
DataManager.Profiles = {}
local function playerAdded(player: Player)
local profile = profileStore:LoadProfileAsync("Player_"..player.UserId)
if profile ~= nil then
profile:AddUserId(player.UserId)
profile:Reconcile()
profile:ListenToRelease(function()
DataManager.Profiles[player] = nil
player:Kick("Profile was released")
end)
if player:IsDescendantOf(Players) then
DataManager.Profiles[player] = profile
else
profile:Release()
end
else
player:Kick()
end
end
local function playerRemoving(player: Player)
local profile = DataManager.Profiles[player]
if profile ~= nil then
profile:Release()
end
end
for _,player in Players:GetPlayers() do
task.spawn(playerAdded, player)
end
Players.PlayerAdded:Connect(playerAdded)
Players.PlayerRemoving:Connect(playerRemoving)
return DataManager
Any help will be appreciated! Also i hope it’s not something dumb.
