I am quite new to scripting so I apologize if I do any simple mistakes.
I am trying to make a text label that will update, and I want to refrence it’s text property by using a variable. I tried doing:
local textVariable = game.StarterGui.ScreenGui.TextLabel.Text
textVariable = "test"
It did not work what so ever with the variable, however if I only refrenced the property without using a variable it worked. The code that worked is showed under:
game.StarterGui.ScreenGui.TextLabel.Text = "test"
I was wondering if anyone could teach me how I could reference the property with a variable so I didn’t have to type out such a long pathway every time.
Thank you for your time!