Carkzowk

Ahh

Jan 9th, 2025
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.41 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local RunService = game:GetService("RunService")
  3. local LocalPlayer = Players.LocalPlayer
  4. local Mouse = LocalPlayer:GetMouse()
  5.  
  6. local CamlockState = false
  7. local Prediction = 0.16
  8. local Locked = true
  9. getgenv().Key = "c"
  10.  
  11. function FindNearestEnemy()
  12. local ClosestDistance, ClosestPlayer = math.huge, nil
  13. local CenterPosition = Vector2.new(
  14. game:GetService("GuiService"):GetScreenResolution().X / 2,
  15. game:GetService("GuiService"):GetScreenResolution().Y / 2
  16. )
  17. for _, Player in ipairs(Players:GetPlayers()) do
  18. if Player ~= LocalPlayer then
  19. local Character = Player.Character
  20. if Character and Character:FindFirstChild("HumanoidRootPart") and Character.Humanoid.Health > 0 then
  21. local Position, IsVisibleOnViewport =
  22. game:GetService("Workspace").CurrentCamera:WorldToViewportPoint(Character.HumanoidRootPart.Position)
  23. if IsVisibleOnViewport then
  24. local Distance = (CenterPosition - Vector2.new(Position.X, Position.Y)).Magnitude
  25. if Distance < ClosestDistance then
  26. ClosestPlayer = Character.HumanoidRootPart
  27. ClosestDistance = Distance
  28. end
  29. end
  30. end
  31. end
  32. end
  33. return ClosestPlayer
  34. end
  35.  
  36. local enemy = nil
  37.  
  38. RunService.Heartbeat:Connect(function()
  39. if CamlockState and enemy then
  40. local camera = workspace.CurrentCamera
  41. camera.CFrame = CFrame.new(camera.CFrame.p, enemy.Position + enemy.Velocity * Prediction)
  42. end
  43. end)
  44.  
  45. Mouse.KeyDown:Connect(function(k)
  46. if k == getgenv().Key then
  47. Locked = not Locked
  48. if Locked then
  49. enemy = FindNearestEnemy()
  50. CamlockState = true
  51. else
  52. CamlockState = false
  53. enemy = nil
  54. end
  55. end
  56. end)
  57.  
  58. -- GUI Elements
  59. local BladLock = Instance.new("ScreenGui")
  60. local Frame = Instance.new("Frame")
  61. local UICorner = Instance.new("UICorner")
  62. local Logo = Instance.new("ImageLabel")
  63. local TextButton = Instance.new("TextButton")
  64. local Notification = Instance.new("Frame")
  65. local NotificationText = Instance.new("TextLabel")
  66. local UICorner_Notification = Instance.new("UICorner")
  67.  
  68. -- Properties
  69. BladLock.Name = "BladLock"
  70. BladLock.Parent = game.CoreGui
  71.  
  72. Frame.Parent = BladLock
  73. Frame.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
  74. Frame.BackgroundTransparency = 0.1
  75. Frame.Size = UDim2.new(0, 240, 0, 100)
  76. Frame.Position = UDim2.new(0.5, -120, 0.5, -50)
  77. Frame.AnchorPoint = Vector2.new(0.5, 0.5)
  78. Frame.Active = true
  79. Frame.Draggable = true
  80. UICorner.CornerRadius = UDim.new(0, 12)
  81. UICorner.Parent = Frame
  82.  
  83. Logo.Name = "Logo"
  84. Logo.Parent = Frame
  85. Logo.BackgroundTransparency = 1
  86. Logo.Size = UDim2.new(0, 70, 0, 70)
  87. Logo.Position = UDim2.new(0.05, 0, 0.15, 0)
  88. Logo.Image = "rbxassetid://1025558188"
  89.  
  90. TextButton.Parent = Frame
  91. TextButton.Size = UDim2.new(0, 140, 0, 40)
  92. TextButton.Position = UDim2.new(0.4, 0, 0.3, 0)
  93. TextButton.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
  94. TextButton.Text = "Toggle CamLock"
  95. TextButton.Font = Enum.Font.SourceSansBold
  96. TextButton.TextScaled = true
  97. TextButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  98. local ButtonCorner = Instance.new("UICorner")
  99. ButtonCorner.CornerRadius = UDim.new(0, 8)
  100. ButtonCorner.Parent = TextButton
  101.  
  102. TextButton.MouseButton1Click:Connect(function()
  103. CamlockState = not CamlockState
  104. enemy = CamlockState and FindNearestEnemy() or nil
  105. TextButton.Text = CamlockState and "ON" or "OFF"
  106. end)
  107.  
  108. -- Notification Badge
  109. Notification.Parent = BladLock
  110. Notification.BackgroundColor3 = Color3.fromRGB(35, 35, 35)
  111. Notification.Size = UDim2.new(0, 300, 0, 50)
  112. Notification.Position = UDim2.new(0.5, -150, 0.8, 0)
  113. Notification.AnchorPoint = Vector2.new(0.5, 0.5)
  114. Notification.BackgroundTransparency = 0.2
  115. UICorner_Notification.CornerRadius = UDim.new(0, 12)
  116. UICorner_Notification.Parent = Notification
  117.  
  118. NotificationText.Parent = Notification
  119. NotificationText.Size = UDim2.new(1, 0, 1, 0)
  120. NotificationText.Font = Enum.Font.SourceSansBold
  121. NotificationText.TextScaled = true
  122. NotificationText.TextColor3 = Color3.fromRGB(255, 255, 255)
  123. NotificationText.Text = "Don't forget to subscribe @zcriptzplayzz!"
  124. NotificationText.BackgroundTransparency = 1
  125.  
  126. -- Auto-hide notification
  127. task.spawn(function()
  128. wait(5)
  129. Notification:Destroy()
  130. end)
Advertisement
Add Comment
Please, Sign In to add comment