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

Text cannot be assigned to?

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

2 comments

0

Are you sure the error is coming from this section of code?

0

Yes I am. The error is exactly "Text cannot be assigned to"

2 answers

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)

?

Was fixed by replacing

PartInfo.Position.Text

To

PartInfo:FindFirstChild("Position").Text

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