Upgrading tower problem

im making a tower defense game but when i try to make the new upgrade system it doesnt work

  1. What do you want to achieve? i wanna make the tower upgrade through going into the number values (Level and NextLevel) and when it goes through nextlevel value then it haves the stats of the folder of the next level value
    Captura de pantalla 2024-05-23 001102

  2. What is the issue? I get this error "Upgrades is not a valid member of Folder "Workspace.Towers.Soldier.Upgrades.1"
    Captura de pantalla 2024-05-23 001305

  3. What solutions have you tried so far? I have no idea how to fix this

local upgradeTower = selectedTower.Upgrades[selectedTower.Level.Value].Config.Level.NextLevel
		local upgradeSuccess = spawnTowerFunction:InvokeServer(upgradeTower.Value, selectedTower.PrimaryPart.CFrame, selectedTower)

i think what is happening is that “selectedTower” = Workspace.Towers.Soldier.Upgrades.1
And since you are trying to search the folder “1” for something named “Upgrades” it gives an error

i still need help in this… what i was trying to do is try to upgrade the tower by folders, i mean in local upgradeTower = selectedTower.Upgrades[selectedTower.Level.Value].Config.NextLevel when upgraded then the selectedtower.level.value is now 1 because of the selectedtower.level.value.config.nextlevel.value which is supposed to eh get the other level folder i can’t explain like a expert because im still learning english also this was a objectvalue before