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 am making a tower defense game, recently I switched from keeping towers in tables and moved them to arrays allowing me to add things like skins.
For example:
Before - SelectedTowers = {“Scout”}
Now -
SelectedTowers = {
["Scout"] = {
Name = "Scout",
Skin = "Default",
OwnedSkins = "Default",
Perk = "None"}
}
- What is the issue? Include screenshots / videos if possible!
Everything works except removing towers from the dictionary. The image isn’t actually from my game but a simple recreations. I set the tower to nil hoping to remove it but after printing it stays there. Thus I can’t unequip towers since it stays in the dictionary.
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I’ve tried table.remove but it doesn’t work with arrays. Other people who have similar questions ask about table.remove but I’m not using it.
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.