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

Text cannot be assigned to?

Asked by 9 years ago

I'm trying to make a GUI to show the selected Part position and size, but now, when I try to update the respective labels, I can't because an error occurs.

Error: Text cannot be assigned to

Code:

        PartInfo.NameBox.Text = part.Name
        PartInfo.Position.Text = "Position: "..(part.Position.X)..", "..(part.Position.Y)..", "..(part.Position.Z)
        PartInfo.Size.Text = "Size: "..(part.Size.X)..", "..(part.Size.Y)..", "..(part.Size.Z)

Edit: forgot to tell that part is equal to Mouse.Target

0
Are you sure the error is coming from this section of code? Trewier 146 — 9y
0
Yes I am. The error is exactly "Text cannot be assigned to" Tytanlore 15 — 9y

2 answers

Log in to vote
0
Answered by
Mr_Octree 101
9 years ago

Instead of

PartInfo.Position.Text = "Position: "..(part.Position.X)..", "..(part.Position.Y)..", "..(part.Position.Z)
PartInfo.Size.Text = "Size: "..(part.Size.X)..", "..(part.Size.Y)..", "..(part.Size.Z)

Can't you just put

PartInfo.Position.Text = ("Position: "..part.Position)
PartInfo.Size.Text = ("Size: "..part.Size)

?

Ad
Log in to vote
0
Answered by 9 years ago

Was fixed by replacing

PartInfo.Position.Text

To

PartInfo:FindFirstChild("Position").Text

Answer this question