In my custom admin command module script, I’m attempting to update a players data using their userid as the key and getting the userid from game:GetService("Players"):GetUserIdFromNameAsync().
It looks like this:
local player2userid
local success,response
success,response = pcall(function()
player2userid = Players:GetUserIdFromNameAsync(target)
end)
if success then
local getdata = module.PlayerDataBase(player2userid)
if getdata ~= nil then
local punishmenthistory = getdata["PunishmentHistory"]
for i, punishment in pairs(punishmenthistory) do
if punishment["PunishmentType"] == "pban" or punishment["PunishmentType"] == "tban" and
punishment["Active"] == true then
DS:UpdateAsync(player2userid, function(getdata)
getdata["PunishmentHistory"][i]["Active"] = false
return true, tostring(Players:GetNameFromUserIdAsync(player2userid)).." was unbanned!"
end)
However when I do that, It returns:
“513: Attribute userId Format is invalid”.
I’m sure 513 is some form of error code I can look up, but google doesn’t reveal anything useful.
Nobody seems to have talked about it on the forums either.
What am I missing?