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)
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)