script.Parent.Touched:connect(function(hit) local h = hit local ca = h:FindFirstChild("Cash") if ca then local civ = script.Parent.Parent.Parent.Parent.Values.InternalCash.Value if civ then local cav = ca.Value civ = civ +cav end end end)
No errors occur, but nothing happens.
You had some mistakes, and I explained every single one to the best of my ability.
script.Parent.Touched:connect(function(hit) -- no need for local h local ca = hit.Parent:findFirstChild("Cash") -- hit is the part that touched, the value is in the character, so you have to do hit.Parent if ca then local civ = script.Parent.Parent.Parent.Parent.Values.InternalCash -- defining something with ".Value" won't work if civ then -- no need for local cav, just use ca civ.Value = civ.Value + ca.Value end end end)
Hope it helps!
As absolute pointed out, line 5 is a problem. But why? Well, when you make a variable equal to a property, no reference to the original object is retained. This means that editing the variable later will not change the property, and if the property changes, the variable will not change with it. The variable will become equal to the value of the property, but it won't actually affect the object.
Therefore, make your variables equal to object. Then you can use the properties, as absolute showed you.