So First Of Make A ScreenGui....
Done?
Good
Then Insert A Local Script Name It What Ever You Desire
And Paste This Code In It
local Mouse = game.Players.LocalPlayer:GetMouse() local Off = false local OnGui = false while wait() do for i,v in pairs(script.Parent:GetChildren()) do if v:FindFirstChild("Draggable") then v.MouseEnter:Connect(function() OnGui = true end) v.MouseLeave:Connect(function() OnGui = false end) Mouse.Button1Down:Connect(function() if OnGui then Off = true end end) Mouse.Button1Up:Connect(function() Off = false end) while wait() do if Off then v.Position = UDim2.new(0,Mouse.X,0,Mouse.Y) end end end end end
Then Make A Frame And Add A BoolValue In It And Name It "Draggable"
Without Quotation Marks
After That You Should Be Able To Hold Down Your Lest Mouse Button Whilst On The Frame And Move Your Mouse Where Ever You Want
NOTE: THIS DOSENT WORK ON MOBILE (i think)
Closed as off-topic by greatneil80
This question has been closed by our community as being off-topic from ROBLOX Lua Scripting.
Why was this question closed?