Hello. I'm using a local script to do this in.
function ChangeText()
local Text = script.Parent.Text
Text = "dsadad"
end
ChangeText()
It will not do anything. Please help!
Hello. I'm using a local script to do this in.
function ChangeText()
local Text = script.Parent.Text
Text = "dsadad"
end
ChangeText()
It will not do anything. Please help!
It's because your variable called Text is directly referencing the Text of your TextLabel/Button. When you go and do
Text = "dsadad"
You're actually changing the variable and not the TextLabel/Button.
function ChangeText()
local Text = script.Parent
Text.Text = "dsadad"
end
ChangeText()
The code above will actually change the Text of the TextLabel/Button.
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
What is script.Parent.Text exactly
Tip, when changing Properties of things, dont reference the Property you want to change inside of the Variable! Hope this helps.