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

Is it possible to make two TextLabels copy the text of a TextLabel parent?

Asked by 2 years ago

Basically i have 3 TextLabels and I want them all to display the same text. the 2 that are copying are outlines https://pasteboard.co/Dzftyl0qZCH6.png

0
I seen the answer below, make sure to mark it as the answer :) Antelear 185 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago

It is possible. All we need to do is set the child's text as the parent's text, like this:

Child.Text = Parent.Text

In your case, I think it's supposed to be like this:

Insert a LocalScript into the Amount

local Amount = script.Parent

-- // Since your outline's name are the same, we're gonna use a for loop

for i,v in pairs(Amount:GetChildren()) do
    if v:IsA("TextLabel") and v.Name == "outline" then
        v.Text = Amount.Text
    end
end

I'm not sure what exactly you're trying to make, but this code is just an idea of how it's gonna work.

0
ah thanks dude! User#31501 0 — 2y
Ad

Answer this question