local tool = Instance.new("Tool") tool.Name = "Boogie Woogie" tool.RequiresHandle = true local handle = Instance.new("Part") handle.Name = "Handle" handle.Size = Vector3.new(1, 1, 1) handle.Anchored = false handle.CanCollide = false handle.Transparency = 1 -- Make the handle invisible handle.Parent = tool tool.Grip = CFrame.new(0, -0.5, 0) local player = game.Players.LocalPlayer local mouse = player:GetMouse() local hoveredPart local originalColor local equipped = false local locked = false -- Create the Sound object local sound = Instance.new("Sound") sound.SoundId = "rbxassetid://6892830182" sound.Volume = 1 sound.Parent = player:WaitForChild("PlayerGui") -- Parent the sound to PlayerGui to ensure it's audible -- Create the lock/unlock button local screenGui = Instance.new("ScreenGui") screenGui.Name = "LockGui" screenGui.Parent = player:WaitForChild("PlayerGui") local button = Instance.new("TextButton") button.Size = UDim2.new(0, 100, 0, 50) button.Position = UDim2.new(1, -110, 0, 10) -- Top-right corner button.Text = "Lock" button.BackgroundColor3 = Color3.fromRGB(70, 130, 180) -- SteelBlue button.TextColor3 = Color3.fromRGB(255, 255, 255) -- White button.Font = Enum.Font.SourceSansBold button.TextSize = 24 button.BorderSizePixel = 0 button.Parent = screenGui local uiCorner = Instance.new("UICorner") uiCorner.CornerRadius = UDim.new(0, 10) -- Rounded corners uiCorner.Parent = button local uiStroke = Instance.new("UIStroke") uiStroke.Color = Color3.fromRGB(0, 0, 0) -- Black border uiStroke.Thickness = 2 uiStroke.Parent = button button.MouseEnter:Connect(function() button.BackgroundColor3 = Color3.fromRGB(65, 105, 225) -- RoyalBlue on hover end) button.MouseLeave:Connect(function() button.BackgroundColor3 = Color3.fromRGB(70, 130, 180) -- SteelBlue end) -- Function to add a light effect to the part local function addLight(part) if part then local light = Instance.new("PointLight") light.Color = Color3.new(0, 0, 1) -- Blue color light.Range = 10 light.Brightness = 2 light.Parent = part end end -- Function to remove the light effect from the part local function removeLight(part) if part then local light = part:FindFirstChildOfClass("PointLight") if light then light:Destroy() end end end -- Function to handle tool activation local function onActivated() if hoveredPart and not hoveredPart.Anchored then local character = player.Character local rootPart = character:FindFirstChild("HumanoidRootPart") if rootPart then local partCFrame = hoveredPart.CFrame hoveredPart.CFrame = rootPart.CFrame rootPart.CFrame = partCFrame sound:Play() -- Play the sound end end end -- Function to handle mouse movement and touch local function onMouseMove() if equipped and not locked then local target = mouse.Target if target and target:IsA("BasePart") and not target.Anchored then if hoveredPart ~= target then if hoveredPart then removeLight(hoveredPart) -- Remove light from the previous part hoveredPart.BrickColor = originalColor -- Reset the previous part's color end originalColor = target.BrickColor -- Store the original color target.BrickColor = BrickColor.new("Bright blue") -- Highlight the new part addLight(target) -- Add light to the new part hoveredPart = target end else if hoveredPart then removeLight(hoveredPart) -- Remove light when not hovering over any part hoveredPart.BrickColor = originalColor -- Reset the part's color hoveredPart = nil end end end end -- Function to handle equipping the tool local function onEquipped() equipped = true end -- Function to handle unequipping the tool local function onUnequipped() equipped = false if hoveredPart and not locked then removeLight(hoveredPart) -- Remove light when the tool is unequipped hoveredPart.BrickColor = originalColor -- Reset the part's color hoveredPart = nil end end -- Function to handle lock/unlock button click button.MouseButton1Click:Connect(function() locked = not locked if locked then button.Text = "Unlock" else button.Text = "Lock" if hoveredPart then removeLight(hoveredPart) hoveredPart.BrickColor = originalColor hoveredPart = nil end end end) -- Connect events mouse.Move:Connect(onMouseMove) tool.Activated:Connect(onActivated) tool.Equipped:Connect(onEquipped) tool.Unequipped:Connect(onUnequipped) tool.Parent = player.Backpack