Im making a simple tycoon and for the droplets that fall from the dropper, they have a numberValue of 1. The collector also has a numberValue, when the droplets fall on the collector the collecotr's script is supposed to add the value of the droplet to itself but i keep getting an error
Code
script.Parent.Touched:Connect(function(hit)
local coin = game.Workspace:WaitForChild("coin")
if hit == coin then
script.Parent.Value += 1
end
end)
error
Workspace.Collector.Script:4: attempt to perform arithmetic (add) on Instance and number

1 comment
basically you tried to add 1 to an instance (object), which you can't do