I need some help fixing this text label script

Hi,

So theres something wrong with related to the text labels properties.

Price.MouseButton1Click:Connect(function()
	local Purchased = Instance.new("TextLabel")
	Purchased.Parent = script.Parent
	Purchased.Position = Vector3.new(0.061, 0, 0.797, 0)
	Purchased.Size = Vector3.new(129, 0, 50)
	Purchased.Font = "Cartoon"
	Purchased.TextScaled = true
	Purchased.Text = "Purchased"
end)

What exactly is wrong with it? :thinking:

Oh wait I found it, you’re using Vector3's instead of UDim2's

Price.MouseButton1Click:Connect(function()
	local Purchased = Instance.new("TextLabel")
	Purchased.Parent = script.Parent
	Purchased.Position = UDim2.new(0.061, 0, 0.797, 0)
	Purchased.Size = UDim2.new(129, 0, 50)
	Purchased.Font = "Cartoon"
	Purchased.TextScaled = true
	Purchased.Text = "Purchased"
end)

When you change the size and position of UI elements, you use UDims. So just replace Vector3.new with UDim2.new

oh. Because its not 3D and it’s UI related. Okay. Thanks. Im going to test it.

Price.MouseButton1Click:Connect(function()
	local Purchased = Instance.new("TextLabel")
	Purchased.Parent = script.Parent
	Purchased.Position = UDim2.new(0.061, 0, 0.797, 0)
	Purchased.Size = UDim2.new(0, 129, 0, 50)
	Purchased.Font = "Cartoon"
	Purchased.TextScaled = true
	Purchased.Text = "Purchased"
end)

You should probably stick to using either just scale or just offset (I’d go with scale) when setting the UDim2 values for both the “Size” and “Position” properties of GuiObject instances.