Hi, I have been creating a script recently and have been trying to add to it to help myself learn, though I have recently come across a problem that I cannot work out.
The problem is that I have created a textlabel in my gui and entered some text into it via the properties menu. I then went into my script and I intended to change the text if a random number is below or above 50, though what actually happens is that the text in the gui doesn’t change at all
Here’s the script,
a = 0
money = game.Workspace.money
maintextgui = game.StarterGui.ScreenGui.Frame.MainTextGui.Text
wait(5)
math.randomseed(tick())
for _ = 1, 1 do
a = math.random(100)
print(a)
if a <= 50 then
print("Below 50!")
money.Value = money.Value - 1
maintextgui = "Below 50"
else
print("Above 50!")
money.Value = money.Value + 1
maintextgui = "Above 50!"
end
end
Could I please have help in solving this please?
Just a note, the money part relates to an intvalue, which I’m assuming doesn’t relate to the problem, so you can ignore that part, just didn’t want to cause more problems by deleting it and possibly causing a misunderstanding
Thanks!

3 comments
you are changing the value of a variable, not the text itself. remove the last .Text from your variable, and put those in when changing the text
So like maintextgui.Text instead? I've just tried that and it isn't working
Make sure you're using a LocalScript. ServerScripts do not work for GUIs.