local Players = game:GetService("Players") local UserInputService = game:GetService("UserInputService") local player = Players.LocalPlayer or Players:GetPlayers()[1] local treesFolder = workspace:WaitForChild("TreesFolder") -- UI Setup local sg = Instance.new("ScreenGui", player:WaitForChild("PlayerGui")) sg.Name = "HitpartPhysicsTest" local frame = Instance.new("Frame", sg) frame.Size = UDim2.new(0, 220, 0, 120) frame.Position = UDim2.new(0.5, -110, 0.4, 0) frame.BackgroundColor3 = Color3.fromRGB(25, 25, 25) frame.BorderSizePixel = 0 frame.Active = true local btn = Instance.new("TextButton", frame) btn.Size = UDim2.new(0.9, 0, 0.4, 0) btn.Position = UDim2.new(0.05, 0, 0.1, 0) btn.Text = "STATIONARY LOOP: OFF" btn.Font = Enum.Font.RobotoMono btn.TextSize = 13 btn.TextColor3 = Color3.new(1, 1, 1) btn.BackgroundColor3 = Color3.fromRGB(150, 0, 0) local visBtn = Instance.new("TextButton", frame) visBtn.Size = UDim2.new(0.9, 0, 0.35, 0) visBtn.Position = UDim2.new(0.05, 0, 0.55, 0) visBtn.Text = "SHOW HITPARTS: OFF" visBtn.Font = Enum.Font.RobotoMono visBtn.TextSize = 12 visBtn.TextColor3 = Color3.new(1, 1, 1) visBtn.BackgroundColor3 = Color3.fromRGB(60, 60, 60) -- Dragging Logic local dragging, dragStart, 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) 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) local looping = false local showing = false local lockCF = nil -- This stores the position when you click the button -- Teleport Logic (Locked Position) local function teleportToLock() if not lockCF then return end for _, item in pairs(treesFolder:GetDescendants()) do if item.Name == "Hitpart" and item:IsA("BasePart") then item.CFrame = lockCF item.AssemblyLinearVelocity = Vector3.zero item.AssemblyAngularVelocity = Vector3.zero end end end -- Visibility Logic local function updateVisibility() for _, item in pairs(treesFolder:GetDescendants()) do if item.Name == "Hitpart" and item:IsA("BasePart") then if showing then item.Transparency = 0.5 if not item:FindFirstChild("HitpartHighlight") then local box = Instance.new("SelectionBox") box.Name = "HitpartHighlight" box.Adornee = item box.Color3 = Color3.fromRGB(0, 255, 255) box.LineThickness = 0.05 box.Parent = item end else item.Transparency = 1 if item:FindFirstChild("HitpartHighlight") then item.HitpartHighlight:Destroy() end end end end end -- Button Connections btn.MouseButton1Click:Connect(function() looping = not looping if looping then -- Capture position ONCE when turned on local char = player.Character if char and char:FindFirstChild("HumanoidRootPart") then lockCF = char.HumanoidRootPart.CFrame * CFrame.new(0, 0, -10) end btn.Text = "STATIONARY LOOP: ON" btn.BackgroundColor3 = Color3.fromRGB(0, 150, 0) else lockCF = nil btn.Text = "STATIONARY LOOP: OFF" btn.BackgroundColor3 = Color3.fromRGB(150, 0, 0) end task.spawn(function() while looping do teleportToLock() task.wait(0.1) end end) end) visBtn.MouseButton1Click:Connect(function() showing = not showing visBtn.Text = showing and "SHOW HITPARTS: ON" or "SHOW HITPARTS: OFF" visBtn.BackgroundColor3 = showing and Color3.fromRGB(0, 120, 255) or Color3.fromRGB(60, 60, 60) updateVisibility() end)