Advertisement
Familycade

Untitled

Mar 29th, 2025
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.95 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local RunService = game:GetService("RunService")
  3. local StarterGui = game:GetService("StarterGui")
  4. local LocalPlayer = Players.LocalPlayer
  5. local Mouse = game.Players.LocalPlayer:GetMouse()
  6. local CamlockState = false
  7. local Prediction = 0.1768521
  8.  
  9. function FindNearestEnemy()
  10. local ClosestDistance, ClosestPlayer = math.huge, nil
  11. local CenterPosition = Vector2.new(game:GetService("GuiService"):GetScreenResolution().X / 2, game:GetService("GuiService"):GetScreenResolution().Y / 2)
  12.  
  13. for _, Player in ipairs(game:GetService("Players"):GetPlayers()) do
  14. if Player ~= LocalPlayer then
  15. local Character = Player.Character
  16. if Character and Character:FindFirstChild("HumanoidRootPart") and Character.Humanoid.Health > 0 then
  17. local Position, IsVisibleOnViewport = game:GetService("Workspace").CurrentCamera:WorldToViewportPoint(Character.HumanoidRootPart.Position)
  18. if IsVisibleOnViewport then
  19. local Distance = (CenterPosition - Vector2.new(Position.X, Position.Y)).Magnitude
  20. if Distance < ClosestDistance then
  21. ClosestPlayer = Player
  22. ClosestDistance = Distance
  23. end
  24. end
  25. end
  26. end
  27. end
  28.  
  29. return ClosestPlayer
  30. end
  31.  
  32. local function createHighlight(target)
  33. if target and target.Character then
  34. local highlight = Instance.new("Highlight")
  35. highlight.Adornee = target.Character
  36. highlight.FillColor = Color3.fromRGB(255, 0, 0)
  37. highlight.OutlineColor = Color3.fromRGB(0, 0, 0)
  38. highlight.FillTransparency = 0.5
  39. highlight.OutlineTransparency = 0
  40. highlight.Parent = target.Character
  41. return highlight
  42. end
  43. end
  44.  
  45. local function removeHighlight(target)
  46. if target and target.Character then
  47. for _, child in ipairs(target.Character:GetChildren()) do
  48. if child:IsA("Highlight") then
  49. child:Destroy()
  50. end
  51. end
  52. end
  53. end
  54.  
  55. local enemy = nil
  56. local highlightInstance = nil
  57.  
  58. RunService.Heartbeat:Connect(function()
  59. if CamlockState and enemy and enemy.Character then
  60. local camera = workspace.CurrentCamera
  61. local targetPart = enemy.Character:FindFirstChild("HumanoidRootPart")
  62. if targetPart then
  63. camera.CFrame = CFrame.new(camera.CFrame.p, targetPart.Position + targetPart.Velocity * Prediction)
  64. end
  65. end
  66. end)
  67.  
  68. local veerve = Instance.new("ScreenGui")
  69. local Frame = Instance.new("Frame")
  70. local UICorner = Instance.new("UICorner")
  71. local TextButton = Instance.new("TextButton")
  72. local UICorner_2 = Instance.new("UICorner")
  73.  
  74. veerve.Name = "intromaxe"
  75. veerve.Parent = game.CoreGui
  76. veerve.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  77.  
  78. Frame.Parent = veerve
  79. Frame.BackgroundColor3 = Color3.fromRGB(165, 42, 42)
  80. Frame.BorderColor3 = Color3.fromRGB(0, 0, 0)
  81. Frame.BorderSizePixel = 0
  82. Frame.Position = UDim2.new(0.5, -50, 0.5, -50)
  83. Frame.Size = UDim2.new(0, 110, 0, 70)
  84. Frame.Active = true
  85. Frame.Draggable = true
  86.  
  87. UICorner.Parent = Frame
  88.  
  89. TextButton.Parent = Frame
  90. TextButton.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  91. TextButton.BorderColor3 = Color3.fromRGB(0, 0, 0)
  92. TextButton.BorderSizePixel = 0
  93. TextButton.Position = UDim2.new(0.1, 0, 0.1, 0)
  94. TextButton.Size = UDim2.new(0.8, 0, 0.8, 0)
  95. TextButton.Font = Enum.Font.Arcade
  96. TextButton.Text = "cam Off"
  97. TextButton.TextColor3 = Color3.fromRGB(255, 0, 0)
  98. TextButton.TextScaled = true
  99. TextButton.TextSize = 11.000
  100. TextButton.TextWrapped = true
  101.  
  102. TextButton.MouseButton1Click:Connect(function()
  103. CamlockState = not CamlockState
  104. TextButton.Text = CamlockState and "cam On" or "cam Off"
  105.  
  106. if CamlockState then
  107. enemy = FindNearestEnemy()
  108. if enemy then
  109. highlightInstance = createHighlight(enemy)
  110. StarterGui:SetCore("SendNotification", {
  111. Title = "cam",
  112. Text = "cam lock" .. enemy.DisplayName,
  113. Duration = 3
  114. })
  115. end
  116. else
  117. if highlightInstance then
  118. removeHighlight(enemy)
  119. highlightInstance = nil
  120. end
  121. enemy = nil
  122. end
  123. end)
  124.  
  125. UICorner_2.Parent = TextButton
  126.  
  127. local rainbowColors = {
  128. Color3.fromRGB(255, 0, 0),
  129. Color3.fromRGB(255, 165, 0),
  130. Color3.fromRGB(255, 255, 0),
  131. Color3.fromRGB(0, 128, 0),
  132. Color3.fromRGB(0, 0, 255),
  133. Color3.fromRGB(75, 0, 130),
  134. Color3.fromRGB(148, 0, 211)
  135. }
  136.  
  137. local rainbowIndex = 1
  138. local rainbowCycleSpeed = 0.09
  139.  
  140. RunService.RenderStepped:Connect(function(deltaTime)
  141. local index = math.floor(tick() / rainbowCycleSpeed) % #rainbowColors + 1
  142. Frame.BackgroundColor3 = rainbowColors[index]
  143. end)
  144.  
  145. StarterGui:SetCore("SendNotification", {
  146. Title = "cam lock‘",
  147. Text = "made by fanimoto",
  148. Duration = 5
  149. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement