I'm trying to make it so whenever I place an item down, 1 of said item is removed. However, it keeps saying that value is not a valid member of IntValue, even though I had just used it. This is what I have so far:
local function initiatePlacement(itemName)
if gui.TowerAmount[itemName].value > 0 then
cancelPlacement()
dummyModel = items[itemName]:clone()
currentItemName = itemName
for _, object in pairs(dummyModel:GetChildren()) do
if object.Name == "Hitbox" then
object.CanCollide = false
end
end
dummyModel.Parent = workspace
local signal = plane:enable(dummyModel)
signal:connect(function(location, _)
game:GetService("ReplicatedStorage").ClientPlaced:FireServer(currentItemName, location[1])
gui.TowerAmount[itemName].value = gui.TowerAmount[itemName].value - 1
cancelPlacement()
end)
end
end
Line 22 is where the issue is. Any help is appreciated!

3 comments
No answer required, just comment lol.
what?
@unsatiesfie_d Why? because its short? its still an answer to the question he is asking