You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
I recently changed from storing equipped owned towers as strings in table to tables in dictionaries allowing me to give towers information like owned or equipped skins/perks.
What is the issue? Include screenshots / videos if possible!
The for loop errors saying it expected a table and not a string, when “OwnedSkins” is a string…?
I added skins as I thought it maybe considered a string because there was only 1 skin, but when I added several skins it still errored.
3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Adding more skins to the table, no solutions on the developer hub.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
-- This is an example Lua code block
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.
Do you potentially have any other skins that OwnedSkins could be incorrectly set to a string in, considering that you did recently change your data system from storing strings inside tables to storing dictionaries inside tables?
I would advise looking at every single part of your player’s data and making sure you don’t have any junk data lying around from your previous system, because it appears that somewhere OwnedSkins is a string.
If you are moving this data around either through remotes or saving/loading from a data store, some systems don’t allow tables and only pass strings. It seems to me it’s likely you are trying to store/load a table with a data store. If I recall correctly, data stores can’t store tables. You will need to convert it to a json and back (Roblox has functions for doing this). It’s been a while since I’ve touched data stores directly though, so I might have wrong or outdated info here.
No, data stores can and will store tables. I use this all the time to store large lists of data. Although admittedly, I have started to use compression for even larger amounts of data in my data stores.