**So the issue i am getting here is : ** Workspace.TycoonModel.MainItems.ConveyorBelt.CollectorPart.Script:5: attempt to perform arithmetic (add) on nil and number
and this is the code which i have typed:
local CashValue = script.Parent.Parent.Parent.Parent.Values.CashValue
script.parent.Touched:Connect(function(Hit) if Hit.Name == "Part" and Hit:FindFirstChild("CashValue") then CashValue.Value += Hit:FindFirstChild("CashValue").Value Hit:Destroy() end end)
What I am trying to do is to destroy a part which is dropped by the dropper that touches the white shining plate and the end of the conveyor belt, and add cash into the cashvalue.
I will really, REALLY appreaciate all help!
ThankYOU!!
i tryed my best
local CashValue = script.Parent.Parent.Parent.Parent.Values.CashValue script.Parent.Touched:Connect(function(Hit) if Hit.Name == "Part" and Hit:FindFirstChild("CashValue") then CashValue.Value += Hit:FindFirstChild("CashValue").Value Hit:Destroy() end end)