Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

how do you change text lables text by script?

hi can someon teach me how to change text lable text by script

4 comments

0

I know how to make it fade in and out but it’s a lot of lines

0

U need 2 text labels do u want the first one to fade out then the second to fade in after the first fades out

0

That's not what he's asking for.

1 answer

In order to change the text, you need to place a "StringValue" item inside ReplicatedStorage. Then, make this script inside of your textlabel.

game.ReplicatedStorage.StringValue.Changed:Connect(function()
	script.Parent.Text = game.ReplicatedStorage.StringValue.Value
end

And, to change it in another script, simply do:

game.ReplicatedStorage.StringValue.Value = "Insert your text here"

#How it works

How it works is that when the StringValue has the value changed, it will fire a signal to the TextLabel inside of your ScreenGui or any other GuiObject. Furthermore, when you change the StringValue's value to something else, the script inside of your TextLabel recieves your signal and changes it according to the StringValue.

I hope I helped! Comment if it doesn't work, and also show me the script. Adios!

1 comment

0

This answer does not clearly explain how to change the text of a text label. Sure, changing it from the server when the label is in a storage service works, but if the text label is within the player's GUI folder, PlayerGui, the server cannot change its text because it can't access it.

This discussion is preserved as it was. New answers, comments, and votes are closed.