Here is my code:
--Variables local Drill = script.Parent local DrillUpper = Drill:FindFirstChild("Drill upper") local DrillTransparency = DrillUpper.Transparency local Money = Drill.parent.parent:FindFirstChild("CurrencyToCollect") --Variables --Testing print (DrillUpper.Name) print (Drill.Name) print (Money) print (DrillTransparency) --Testing --Function local function TransparencyTest() print ("function works") wait (2) if DrillTransparency == 0 then while (true) do Money.value = Money.value + 1 print (Money) wait(1) end end end --Function --The program TransparencyTest() --The program
Why doesn't the object variable change?
It is no errors.
I saw im am not the only one having problems with this, but they deleted the code so I didn't understand it fully.
All I can really see is on line 26, you have Money.value, capitalization really matters, so make sure to change anywhere it says .value, to .Value. The V in Value always has to be capital.
Also, make sure when you run the game, the DrillTransparency is set to 0.
"Is the IntValue you are trying to change 'Money'? If so, a common mistake is to forget to access the Value property when updating IntValue values. Just use Money.Value instead. e.g. Money.Value = Money.Value + 1".
Yeah, that's the correct answer, so it might work like this, change the line 26 become this:
Money.Value = Money.Value + 1
If it worked, mark this as the correct answer, also thanks for 123marble too.