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?
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)
o1hollow
(boithatnodsotuff)
December 9, 2021, 9:47pm
#3
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.
Forummer
(Forummer)
December 10, 2021, 8:09am
#5
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.