Profile Service Tables ERROR

Howdy.

I spent 6+ hours straight searching the devforum and pretty much the whole internet, WITHOUT a answer so i come here to ask of your help

I m making a classified system

here is the table

	Slot1 = {
		Difficulty = "None",
		IslandName = "None",
		Multiplayer = "Off",
		TimeCreated = "None",
	}

image

prints this error

the server script:

IslandCreatedEvent.OnServerEvent:Connect(function(Player)
	local Slot1Table = SlotSettings:Get(Player, "Slot1")
	
	SlotSettings:Set(Player, Slot1Table["Difficulty"], "Difficulty = true") -- I know this does not set it to true, so if you could also help with that, that would be amazing
end)

the profile service handler module

-- Getter/Setter methods
function PlayerDataHandler:Get(player, key)
	local profile = getProfile(player)
	assert(profile.Data[key], string.format("Data does not exist for key: %s", key))

	return profile.Data[key]
end

function PlayerDataHandler:Set(player, key, value)
	local profile = getProfile(player)
	assert(profile.Data[key], string.format("Data does not exist for key: %s", key))

	assert(type(profile.Data[key]) == type(value))

	profile.Data[key] = value
end

I tried so many methods, none seeming to work. If you need more info im glad to add more, thanks for reading I hope you are able to help

You gotta enclose the keys in square brackets or it won’t work

Slot1 = {
		["Difficulty"] = "None",
		["IslandName"] = "None",
		["Multiplayer"] = "Off",
		["TimeCreated"] = "None",
	}
1 Like

you know, some times i gotta look my self in the mirror and tell my self, was it worth it. And i gotta say bro thank you, cannot say HOW sillly silly dum dum i feel spending all that time with no success for the error to be a small little problem, you are a LIFE saver. And you just put a piece of wisdom in my brain that i will keep with me to the grave, TRULLY thank you, wow crazy thanK YOU!

The fact that you were searching for 6+ hours tho… :skull:

1 Like

its something i will not like to admit to, BUT I can say the times i tried i should of just went to the dev forum, lesson learnt. THANK YOU :sob: :sob: :sob: :pray: :pray: :pray: :pray: :pray:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.