RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"create a script that lets you drag a part with your left click when held"
-- local script local UserInputService = game:GetService("UserInputService") local mouse = game.Players.LocalPlayer:GetMouse() local dragging = false local targetPart = nil mouse.Button1Down:Connect(function() local part = mouse.Target if part and part.Name == "DraggablePart" then dragging = true targetPart = part end end) mouse.Button1Up:Connect(function() dragging = false targetPart = nil end) mouse.Move:Connect(function() if dragging and targetPart then targetPart.Position = mouse.Hit.p end end)