Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

how do you change text lables text by script?

Asked by 4 years ago

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

0
I know how to make it fade in and out but it’s a lot of lines Fricewolf0z -52 — 4y
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 Fricewolf0z -52 — 4y
0
That's not what he's asking for. DeceptiveCaster 3761 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

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!

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. DeceptiveCaster 3761 — 4y
Ad

Answer this question