Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Insignias is not a valid member of Player "Players.player"?

Asked by 3 years ago
Edited 3 years ago

Hi, I have an error when I want to save my data

the script is located in "ServerScriptService"

and I don't know what else to do, I would appreciate your help: c

The script:

local DataStoreService = game:GetService("DataStoreService")

local DataN2 = DataStoreService:GetDataStore("DataN2")

game.Players.PlayerAdded:Connect(function(plr)

local Insignias = Instance.new("Folder",jugador)
Insignias.Name = "Insignias"

local Bienvenido = Instance.new("BoolValue",Insignias)
Bienvenido.Name = "Bienvenido"

local Activador = Instance.new("BoolValue",Bienvenido)
Activador.Name = "Activador"    


local Hecho, MensajeError = pcall(function()
    DataN2:SetAsync(plr.UserId.. "-Activador", plr.Insignias.Bienvenido.Activador.Value)
end)

if Hecho then
    print("Se han guardado los datos con exito(Activador)")
else
    print("Hubo un error al guardar los datos(Activador)")
    warn(MensajeError)
end

end)

1 answer

Log in to vote
0
Answered by 3 years ago

you are parenting the Insignias folder to jugador when it should be parenting to plr

line 12 will error because you are attempting to concentrate a number with a string, use tostring(plr.UserId)

Ad

Answer this question