the towercosts is a module that contains what the towers level cost and how much it costs to place it, the level is the towers current level
and the tower is the tower model
towercosts.Data[tower.Parent.Name][level] is nil. Before subtracting the cash try printing towercosts.Data to see if tower.Parent.Name is in fact a key in the table. You can then also check if level is within that table.
If any one of those are nil, then you can look inside the last [brackets] to see what is missing.
Also, you can open {…} to see what values are inside.
What does the table look like when it is opened? It could be possible that your level variable is a string. consider using tonumber(level) or tostring(level)