im trying to make a computer using a surfacegui and i want the windows on the desktop to be draggable. it works, however, the windows go out of bounds outside of the computer screen, is there a way to make it stay inside the desktop?
script im currently using:
script.Parent.MouseButton1Down:connect(function(x,y)
local startPos = script.Parent.Parent.Position
local movable = true
local conn =
script.Parent.MouseMoved:connect(function(X,Y)
script.Parent.Parent.Position = startPos +
UDim2.new(0,X-x,0,Y-y)
end)
script.Parent.MouseButton1Up:wait()
conn:disconnect()
end)
