Im editing the Team Deathmatch project and adding a new UI text component that displays a count of player gold pick ups. However, when it comes to displaying the count I get the error "attempt to index a string value (upvalue 'GOLD_TEXT')
I've added the following code to the HealthBarControllerClient script:
local GOLD_TEXT = script:GetCustomProperty("GoldText") -- this is the name of the target text box
local carriedGold = tostring(player:GetResource("playerGold"))
GOLD_TEXT.text = carriedGold
It always fails on the "GOLD_TEXT.text = carriedGold" with error "attempt to index a string value (upvalue 'GOLD_TEXT')"
I thought it might be placement in the hierarchy, so Ive played around with that, but no joy