I'm making a game where a player has items, and I'm brand new to scripting. The items variable is global so every script I have can access them, and I'm trying to set a textLabel's text (The script's parent is the textLabel) to my items variable and it's not working!!! What am I doing wrong?
Here is my code:
_G.items = 0 local textLabel = script.Parent textLabel.Text = _G.items
A very inefficient but tolerable way would be: putting a LocalScript inside the textlabel and update the text every frame.
game:GetService("RunService").RenderStepped:connect(function() script.Parent.Text = tostring(_G.items) end)