So as i said in the Title i want to make a gui that a local player can resize like they can change the (x,y) axes.
is that even Possible?
So as i said in the Title i want to make a gui that a local player can resize like they can change the (x,y) axes.
is that even Possible?
First, this is possible and you asked just when I was finished making one!
We need to be able to start the resize so put a button in the frame.
Next we need to detect when the player starts the resize:
local btnDown = false
local frame = --Path to scaling object
local button = --Path to button
button.MouseButton1Down:connect(function()
--Runs when mouse clicks the button
btnDown = true
end)
button.MouseButton1Up:connect(function()
--Runs when the mouse is up
btnDown = false
end)
Now we need to actually resize the frame:
local mouse = game.Players.LocalPlayer:GetMouse()
local btnDown = false
local frame = --Path to scaling object
local button = --Path to button
button.MouseButton1Down:connect(function()
--Runs when mouse clicks the button
btnDown = true
end)
button.MouseButton1Up:connect(function()
--Runs when the mouse is up
btnDown = false
end)
mouse.Move:Connect(function()
if btnDown then
frame.Size = UDim2.new(0,mouse.X,0,mouse.Y) - UDim2.new(0,frame.AbsoluteSize.X,0,frame.AbsoluteSize.Y,0)
end
end)
Please accept this answer if it works!
This discussion is preserved as it was. New answers, comments, and votes are closed.
3 comments
Sorry i messed up! Replace AbsoluteSize with AbsoulePosition!
Thankyou @deadwalker601
No problem