local r={main.gui.MainFrame}local H local o local S local function d(r,H)local d=r.Position-o H.Position=UDim2.new(S.X.Scale,S.X.Offset+d.X,S.Y.Scale,S.Y.Offset+d.Y)if H.AbsolutePosition.Y<0 then H.Position=H.Position+UDim2.new(0,0,0,-H.AbsolutePosition.Y)end end function module.MakeFrameDraggable(d,r)local R=r.DragBar.Drag R.InputBegan:Connect(function(d)if d.UserInputType==clickInput or d.UserInputType==touchInput then H=r o=d.Position S=r.Position d.Changed:Connect(function()if d.UserInputState==Enum.UserInputState.End then H=nil end end)end end)end for r,H in pairs(r)do module:MakeFrameDraggable(H)end
-- << DRAG BARS >>
local dragFrames = { main.gui.MainFrame }
local frameDragging
local dragStart
local startPos
local function dragFrame(input, frame)
	local delta = input.Position - dragStart
	frame.Position =
		UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
	if frame.AbsolutePosition.Y < 0 then
		frame.Position = frame.Position + UDim2.new(0, 0, 0, -frame.AbsolutePosition.Y)
	end
end
function module:MakeFrameDraggable(frame)
	local dragFrame = frame.DragBar.Drag
	dragFrame.InputBegan:Connect(function(input)
		if input.UserInputType == clickInput or input.UserInputType == touchInput then
			frameDragging = frame
			dragStart = input.Position
			startPos = frame.Position
			input.Changed:Connect(function()
				if input.UserInputState == Enum.UserInputState.End then
					frameDragging = nil
				end
			end)
		end
	end)
end
for _, frame in pairs(dragFrames) do
	module:MakeFrameDraggable(frame)
end
