Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- // GUI SETUP \\ --
- local ScreenGui = Instance.new("ScreenGui")
- local Frame = Instance.new("Frame")
- local ToggleBtn = Instance.new("TextButton")
- local UICorner = Instance.new("UICorner")
- local Title = Instance.new("TextLabel")
- -- GUI Protection
- if game:GetService("CoreGui"):FindFirstChild("RobloxGui") then
- ScreenGui.Parent = game:GetService("CoreGui")
- else
- ScreenGui.Parent = game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui")
- end
- ScreenGui.Name = "CloneGlitch_StableCam"
- ScreenGui.ResetOnSpawn = false
- -- Frame
- Frame.Parent = ScreenGui
- Frame.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
- Frame.Position = UDim2.new(0.5, -100, 0.5, -60)
- Frame.Size = UDim2.new(0, 200, 0, 120)
- Frame.Active = true
- Frame.Draggable = true
- -- Title
- Title.Parent = Frame
- Title.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- Title.BackgroundTransparency = 1
- Title.Size = UDim2.new(1, 0, 0, 30)
- Title.Font = Enum.Font.GothamBold
- Title.Text = "Clone Glitch (Stable Cam)"
- Title.TextColor3 = Color3.fromRGB(255, 255, 255)
- Title.TextSize = 16
- -- Button
- ToggleBtn.Parent = Frame
- ToggleBtn.BackgroundColor3 = Color3.fromRGB(255, 50, 50) -- Red
- ToggleBtn.Position = UDim2.new(0.1, 0, 0.4, 0)
- ToggleBtn.Size = UDim2.new(0.8, 0, 0.4, 0)
- ToggleBtn.Font = Enum.Font.GothamBlack
- ToggleBtn.Text = "OFF"
- ToggleBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
- ToggleBtn.TextSize = 24
- UICorner.Parent = ToggleBtn
- UICorner.CornerRadius = UDim.new(0, 8)
- -- // LOGIC \\ --
- local Players = game:GetService("Players")
- local Workspace = game:GetService("Workspace")
- local player = Players.LocalPlayer
- local camera = Workspace.CurrentCamera
- local enabled = false
- local DISTANCE = 7 -- Teleport distance
- local anchorPart = nil
- local function resetCamera()
- if player.Character and player.Character:FindFirstChild("Humanoid") then
- camera.CameraSubject = player.Character.Humanoid
- end
- if anchorPart then
- anchorPart:Destroy()
- anchorPart = nil
- end
- end
- ToggleBtn.MouseButton1Click:Connect(function()
- enabled = not enabled
- if enabled then
- ToggleBtn.Text = "ON"
- ToggleBtn.BackgroundColor3 = Color3.fromRGB(50, 255, 50) -- Green
- -- Create the Anchor Part (The thing the camera will look at)
- if not anchorPart then
- anchorPart = Instance.new("Part")
- anchorPart.Name = "GlitchAnchor"
- anchorPart.Transparency = 1 -- Invisible
- anchorPart.CanCollide = false
- anchorPart.Anchored = true
- anchorPart.Size = Vector3.new(1, 1, 1)
- anchorPart.Parent = Workspace
- end
- -- Switch Camera to the Anchor Part
- camera.CameraSubject = anchorPart
- -- Start the Loop
- task.spawn(function()
- while enabled do
- if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
- local hrp = player.Character.HumanoidRootPart
- -- 1. Update Anchor Position to Match Real Position (Smooth Movement)
- anchorPart.CFrame = hrp.CFrame
- -- Anti-Fling
- hrp.CanCollide = false
- -- 2. Teleport Character LEFT
- hrp.CFrame = hrp.CFrame * CFrame.new(-DISTANCE, 0, 0)
- -- YOUR WAIT
- task.wait(0.0000000000000000000000001)
- -- 3. Teleport Character BACK (Right)
- -- We use the anchorPart position because that is the "Real" center
- if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
- hrp.CFrame = anchorPart.CFrame
- end
- -- YOUR WAIT
- task.wait(0.0000000000000000000000001)
- else
- -- Character missing? Wait a second and try again
- task.wait(1)
- end
- end
- -- Loop ended? Reset camera
- resetCamera()
- end)
- else
- ToggleBtn.Text = "OFF"
- ToggleBtn.BackgroundColor3 = Color3.fromRGB(255, 50, 50) -- Red
- resetCamera()
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment