RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"fix this to still drag when mouse is not on the frame it still drags while holding m1"
local frame = script.Parent local dragging local dragInput local dragStart local startPos frame.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 then dragging = true dragStart = input.Position startPos = frame.Position input.Changed:Connect(function() if input.UserInputState == Enum.UserInputState.End then dragging = false end end) end end) game:GetService("UserInputService").InputChanged:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseMovement and dragging then 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) end end)