Advertisement
NotExotic

Aimbot For Bob ui

Sep 15th, 2023
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. -- Define the variables
  2. local player = game.Players.LocalPlayer
  3. local mouse = player:GetMouse()
  4. local camera = game.Workspace.CurrentCamera
  5. local isRightClicking = false
  6. local lockedPlayer = nil
  7.  
  8. -- Function to make the camera look at a player's head
  9. local function LookAtHead(targetPlayer)
  10. local targetCharacter = targetPlayer.Character
  11. if targetCharacter then
  12. local targetHead = targetCharacter:FindFirstChild("Head")
  13. if targetHead then
  14. camera.CFrame = CFrame.new(camera.CFrame.p, targetHead.Position)
  15. end
  16. end
  17. end
  18.  
  19. -- Listen for RightClick input
  20. mouse.Button2Down:Connect(function()
  21. isRightClicking = true
  22. local players = game.Players:GetPlayers()
  23. local localPlayerIndex = table.find(players, player)
  24. if localPlayerIndex then
  25. table.remove(players, localPlayerIndex)
  26. end
  27. if #players > 0 then
  28. local randomIndex = math.random(1, #players)
  29. lockedPlayer = players[randomIndex]
  30. LookAtHead(lockedPlayer)
  31. end
  32. end)
  33.  
  34. mouse.Button2Up:Connect(function()
  35. isRightClicking = false
  36. lockedPlayer = nil
  37. end)
  38.  
  39. -- Main loop to continuously look at the locked player's head
  40. while true do
  41. if isRightClicking and lockedPlayer then
  42. LookAtHead(lockedPlayer)
  43. end
  44. wait() -- Use the default wait time (60 times per second)
  45. end
  46.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement