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

How do I use a script to change text from a text label?

Asked by 6 years ago

I'm new to scripting and don't really know what i'm doing. I've tried to do this myself before but I couldn't. I appreciate any help! -JoyousCaribou48

0
Please include your code even if it does not work. this shows you have made an attempt at solving your question. User#5423 17 — 6y
0
This is what i've done so far: GodsGraceSavesAll 6 — 6y
0
local text = script.Parent.Text text = "Test" GodsGraceSavesAll 6 — 6y

3 answers

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

Well, the TextLabel object has a property called text that can be change, so what you simply have to do is :

TextLabel.Text = "Something of this sort"

Of course, it depends on where the gui is place, if the gui is placed inside the starter gui, you have to use a local script, however if it is in workspace and you want players to see it, you have to change it via a server script

A couple of other things to note:

1.) to reference things you originally put in starter gui, reference the PlayerGui instead, as all things inside the starter gui are cloned into the player gui when that player joins the game.

Ex:

local playerGui = game.Players.LocalPlayer:WaitForChild("PlayerGui")
0
I'll give that a try! GodsGraceSavesAll 6 — 6y
0
But how do I use this and where? local playerGui = game.Players.LocalPlayer:WaitForChild("PlayerGui") GodsGraceSavesAll 6 — 6y
0
it should be in a local script as |game.Players.LocalPlayer| can only be used on the client theking48989987 2147 — 6y
0
I'm sorry I don't understand i'm newish to scripting. What is the "cilent"? GodsGraceSavesAll 6 — 6y
View all comments (2 more)
0
I’ll just accept your answer thank you for the help! GodsGraceSavesAll 6 — 6y
0
well the clients are the players playing your game and the server is your game, thats a pretty crude way to explain it theking48989987 2147 — 6y
Ad
Log in to vote
0
Answered by 5 years ago

Put This On The Button Which Should Change The Text

Target = script.parent.parent --This MayBe Wrong Cause You Have To Show 'Script' Where It Is.

Target.Text = "The Button Worked"

Log in to vote
0
Answered by 4 years ago
Textlabel.Text = "example"

you might have to change where the pathing goes for example

game.StarterGui.ScreenGui.Frame.TextLabel.Text = "example"

Answer this question