How can i create a mouse scalling frame?

i am trying to make a frame that you can change the size

i found these in robeats

like this:

i tried this:

local UserInputService = game:GetService("UserInputService")

local Players = game:GetService("Players")

local Player = Players.LocalPlayer

local Mouse = Player:GetMouse()

local holding = false

script.Parent.Messages.Sizer.MouseButton1Down:Connect(function()

holding = true

end)

script.Parent.Messages.Sizer.MouseButton1Up:Connect(function()

holding = false

end)

Mouse.Move:Connect(function()

if holding == true then

local Position = UserInputService:GetMouseLocation()

script.Parent.Messages.Size = UDim2.fromOffset(Position.X + 20, Position.Y)

end

end)

but it glitches

You could do while holding = true do instead of if. Not entirely sure if Iā€™m right.

these script works but the ā€œYā€ miss

if i move the mouse up then the frame is smaller

and if i move the mouse down its more bigger

this is that happens:

Not sure if this will work but could you try flipping the X and Y?

it glitches more

My bad, flip it back then try and use fromScale, I think that would work.

making these the screen fill

its the Y position that miss

the X works well

Try and +20 to the Y too, sorry if I keep getting it wrong.

happens these again

i think its because lower Y Position its bigger value

and i need lower Y Position its lower value

I think this is how UDim2 works, it is pretty funky, I could be wrong though

Yes UDim2 Position its normal but UDim2 Size its wrong for that

1 Like