Universal Script 📌
3.2k Views
152 Executions

Drag parts client sided

Universal Script 📌
2 years ago
Get an executor
Please login to perform these actions:

Does it work?

No reports yet

No reports yet. Tried it? Be the first to say.

Also noticed:

Description

Drag parts, if a part wont drag then you aren't close enough too it that should maybe fix it

View Raw
--
local player = game.Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")

-- Create GUI
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "DragSetupGui"
screenGui.ResetOnSpawn = false
screenGui.Parent = playerGui

local button = Instance.new("TextButton")
button.Size = UDim2.new(0, 300, 0, 50)
button.Position = UDim2.new(1, -10, 0.5, -25)  -- Right middle, offset 10px from edge
button.AnchorPoint = Vector2.new(1, 0.5)       -- Anchors to right-middle
button.Text = "Click this button then click the part you want to make draggable"
button.BackgroundColor3 = Color3.fromRGB(0, 170, 255)
button.TextColor3 = Color3.new(1, 1, 1)
button.Font = Enum.Font.SourceSansBold
button.TextSize = 18
button.Parent = screenGui
button.Draggable = false -- Not draggable anymore
button.Active = true     -- Ensure it's clickable
button.TextScaled = true

local selecting = false
local mouse = player:GetMouse()

button.MouseButton1Click:Connect(function()
	selecting = true
	button.Text = "Now click a part..."
end)

mouse.Button1Down:Connect(function()
	if selecting then
		local target = mouse.Target
		if target and target:IsA("BasePart") then
			target.Locked = false
			local dragDetector = Instance.new("DragDetector")
			dragDetector.Name = "Draggable"
			dragDetector.DragStyle = Enum.DragDetectorDragStyle.TranslateViewPlane


Comments

0
Log in to join the conversation. Login
No comments yet. Be the first!

More universal scripts

See all
Universal Script 📌
596
14.0k
Bumped 11 minutes ago
Universal Script 📌
23
1
Approved 23 minutes ago
Script hub
52.0k
220.6k
Bumped 26 minutes ago

Script hub

#7 today

KeylessVerified script badgeNo Lag Hub | KEYLESS 2026

Script hub
2.8M
902.6k
Bumped 28 minutes ago
Key System

Script hub

#6 today

Verified script badgeLumin Hub | #1 | Insta Steal

Script hub
139
7
Approved 1 hour ago
Universal Script 📌
73
4
Approved 2 hours ago