I need this image to always scale to be on the left and touching it using some script.
I’ve tried using text bounds to create the effect, but it doesn’t work and ends up with the screenshot below
local player = game.Players.LocalPlayer
local tix = player.Values.Tix
local image = script.Parent.ImageLabel
local function scale(x, y, screenGui)
local absoluteSize = screenGui.AbsoluteSize
return UDim2.new(x/absoluteSize.X, 0, y/absoluteSize.Y, 0)
end
local textBounds = scale(script.Parent.TextBounds.X,script.Parent.TextBounds.Y,script.Parent.Parent)
task.wait(0.5)
script.Parent.Text = "Tix: "..tix.Value
image.Position = textBounds
tix.Changed:Connect(function()
local newScale = scale(script.Parent.TextBounds.X,script.Parent.TextBounds.Y,script.Parent.Parent)
script.Parent.Text = "Tix: "..tix.Value
image.Position = newScale
game.Workspace.Sounds.Coin:Play()
end)
Please help me!