local s={main.gui.MainFrame}local u local X local x local function y(s,u)local y=s.Position-X u.Position=UDim2.new(x.X.Scale,x.X.Offset+y.X,x.Y.Scale,x.Y.Offset+y.Y)if u.AbsolutePosition.Y<0 then u.Position=u.Position+UDim2.new(0,0,0,-u.AbsolutePosition.Y)end end function module.MakeFrameDraggable(y,s)local t=s.DragBar.Drag t.InputBegan:Connect(function(y)if y.UserInputType==clickInput or y.UserInputType==touchInput then u=s X=y.Position x=s.Position y.Changed:Connect(function()if y.UserInputState==Enum.UserInputState.End then u=nil end end)end end)end for s,u in pairs(s)do module:MakeFrameDraggable(u)end

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


