Hello All
I'm stuck with trying to change the text label in the starter gui. The text label sits in the following hierarchy
Text label is child of a frame The frame is the child of a screengui The screengui is the child of the Starter Gui
I'd like the text in the text label to change when the player hits a brick. The script I am using to do this is below.
The problem is that the text doesn't change when my player hits the brick. I know the touch event is being triggered, becase the seconbd print statement is printing out "You hit the brick". I also know that I have the correct path for the text label as the first print statement is printing out successfully.
Could someone advise me what I am doing wrong here?
Thanks ever so much for your help
Chris
********* Script is here *************************
local txtlbl=game.StarterGui.ScreenGui.Frame.TextLabel print(txtlbl.Text)
script.Parent.Touched:connect(function(part)
if part.Parent:FindFirstChild("HumanoidRootPart") then print ("You hit the brick") txtlbl.Text="There is a change in text" end end)

2 comments
Block codes exist for a reason.. Also you should change text on the player gui not starter gui
Thank you Neil. Can I check what you mean by block codes? Do you mean the indents which occur within loops and if/then blocks?