Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- local RunService = game:GetService("RunService")
- local UserInputService = game:GetService("UserInputService")
- local LocalPlayer = Players.LocalPlayer
- local Mouse = LocalPlayer:GetMouse()
- local CamlockState = false
- local Prediction = 0.1299222231
- -- Function to find the nearest enemy
- function FindNearestEnemy()
- local ClosestDistance, ClosestPlayer = math.huge, nil
- local CenterPosition = Vector2.new(game:GetService("GuiService"):GetScreenResolution().X / 2, game:GetService("GuiService"):GetScreenResolution().Y / 2)
- for _, Player in ipairs(game:GetService("Players"):GetPlayers()) do
- if Player ~= LocalPlayer then
- local Character = Player.Character
- if Character and Character:FindFirstChild("HumanoidRootPart") and Character.Humanoid.Health > 0 then
- local Position, IsVisibleOnViewport = game:GetService("Workspace").CurrentCamera:WorldToViewportPoint(Character.HumanoidRootPart.Position)
- if IsVisibleOnViewport then
- local Distance = (CenterPosition - Vector2.new(Position.X, Position.Y)).Magnitude
- if Distance < ClosestDistance then
- ClosestPlayer = Character.HumanoidRootPart
- ClosestDistance = Distance
- end
- end
- end
- end
- end
- return ClosestPlayer
- end
- local enemy = nil
- -- Function to aim the camera at the nearest enemy's HumanoidRootPart
- RunService.Heartbeat:Connect(function()
- if CamlockState == true then
- if enemy then
- local camera = workspace.CurrentCamera
- -- Use a single prediction value to anticipate enemy movement
- camera.CFrame = CFrame.new(camera.CFrame.p, enemy.Position + enemy.Velocity * Prediction)
- end
- end
- end)
- -- PURIFY UI Setup
- local PURIFY = Instance.new("ScreenGui")
- local Frame = Instance.new("Frame")
- local UICorner = Instance.new("UICorner")
- local TextButton = Instance.new("TextButton")
- local UICorner_2 = Instance.new("UICorner")
- local UIStroke = Instance.new("UIStroke")
- -- Properties
- PURIFY.Name = "PURIFY"
- PURIFY.Parent = game.CoreGui
- PURIFY.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- Frame.Parent = PURIFY
- Frame.BackgroundColor3 = Color3.fromRGB(0, 0, 0) -- Pure black for a sleek look
- Frame.BorderColor3 = Color3.fromRGB(0, 0, 0)
- Frame.BorderSizePixel = 0
- Frame.Position = UDim2.new(0.133798108, 0, 0.20107238, 0)
- Frame.Size = UDim2.new(0, 202, 0, 70)
- Frame.Active = true
- Frame.Draggable = true
- -- Ensure the frame stays centered on the screen
- local function TopContainer()
- Frame.Position = UDim2.new(0.5, -Frame.AbsoluteSize.X / 2, 0, -Frame.AbsoluteSize.Y / 2)
- end
- TopContainer()
- Frame:GetPropertyChangedSignal("AbsoluteSize"):Connect(TopContainer)
- UICorner.Parent = Frame
- TextButton.Parent = Frame
- TextButton.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- TextButton.BackgroundTransparency = 5.000
- TextButton.BorderColor3 = Color3.fromRGB(0, 0, 0)
- TextButton.BorderSizePixel = 0
- TextButton.Position = UDim2.new(0.0792079195, 0, 0.18571429, 0)
- TextButton.Size = UDim2.new(0, 170, 0, 44)
- TextButton.Font = Enum.Font.SourceSansSemibold
- TextButton.Text = "PURIFY OFF" -- Changed text to match PURIFY mode
- TextButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- TextButton.TextScaled = true
- TextButton.TextSize = 11.000
- TextButton.TextWrapped = true
- -- Add UIStroke for sea-blue gradient effect
- UIStroke.Parent = Frame
- UIStroke.Thickness = 2
- UIStroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
- UIStroke.Color = Color3.fromRGB(0, 255, 255) -- Initial sea blue color
- -- Function to create a gradient sea-blue effect
- local function SeaBlueGradientEffect()
- local hue = 180 -- Start at a sea-blue hue
- while true do
- -- Transition between light blue and deep sea blue colors
- local color = Color3.fromHSV(hue / 360, 0.8, 1) -- Saturation and brightness set to give a more sea-like look
- UIStroke.Color = color
- TextButton.TextColor3 = color
- -- Slow the transition down for a smoother effect
- hue = (hue - 1) % 360
- if hue < 180 then hue = 240 end -- Cycle between 180 (light blue) and 240 (deeper blue)
- wait(0.05)
- end
- end
- -- Start the sea-blue gradient effect
- spawn(SeaBlueGradientEffect)
- -- Toggle the camlock and PURIFY mode on button click
- TextButton.MouseButton1Click:Connect(function()
- CamlockState = not CamlockState
- TextButton.Text = CamlockState and "PURIFY ON" or "PURIFY OFF" -- Toggle between ON and OFF
- enemy = CamlockState and FindNearestEnemy() or nil
- end)
- UICorner_2.Parent = TextButton
- -- Listen for the "Q" key press to toggle camlock
- UserInputService.InputBegan:Connect(function(input, gameProcessed)
- if gameProcessed then return end -- Ignore input if it's being used by something else
- if input.KeyCode == Enum.KeyCode.Q then
- CamlockState = not CamlockState
- TextButton.Text = CamlockState and "PURIFY ON" or "PURIFY OFF" -- Toggle between ON and OFF
- enemy = CamlockState and FindNearestEnemy() or nil
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement