Advertisement
UiiN2IPCEO

aimbot

Jun 19th, 2019
7,629
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.66 KB | None | 0 0
  1. --yes, i skidded this
  2.  
  3. Key = "E"
  4. turnBody = false
  5. target = "Head"  
  6.  
  7.  
  8.  
  9. char = game.Players.LocalPlayer.Character
  10. camera = workspace.Camera
  11. part = nil
  12. enabled = false
  13. mouse = game.Players.LocalPlayer:GetMouse()
  14.  
  15.  
  16. function onKeyPress(actionName, State, inputObject)
  17.     if State == Enum.UserInputState.Begin then
  18.         if mouse.Target ~= nil and mouse.Target:FindFirstAncestorWhichIsA("Model"):FindFirstChild("Humanoid") then
  19.             part = mouse.Target:FindFirstAncestorWhichIsA("Model")[target]
  20.             enabled = true
  21.             camera.CFrame = CFrame.new(Vector3.new(camera.CFrame.X, camera.CFrame.Y,camera.CFrame.Z),Vector3.new(part.CFrame.p.X,part.CFrame.p.Y,part.CFrame.p.Z) )
  22.             if turnBody then
  23.                 char.HumanoidRootPart.CFrame = CFrame.new(Vector3.new(char.HumanoidRootPart.CFrame.X,char.HumanoidRootPart.CFrame.Y,char.HumanoidRootPart.CFrame.Z), Vector3.new(part.CFrame.p.X,char.HumanoidRootPart.CFrame.p.Y,part.CFrame.p.Z))
  24.             end
  25.         else
  26.             enabled = false
  27.         end
  28.     end
  29.        
  30.     if State == Enum.UserInputState.End then
  31.         enabled = false
  32.     end
  33. end
  34. game.ContextActionService:BindAction("keyPress", onKeyPress, false, Enum.KeyCode[Key])
  35.  
  36. function cameraChanged()
  37.     camera.Changed:Connect(function()
  38.         if enabled then
  39.             camera.CFrame = CFrame.new(Vector3.new(camera.CFrame.X, camera.CFrame.Y,camera.CFrame.Z),Vector3.new(part.CFrame.p.X,part.CFrame.p.Y,part.CFrame.p.Z) )
  40.             if turnBody then
  41.                 char.HumanoidRootPart.CFrame = CFrame.new(Vector3.new(char.HumanoidRootPart.CFrame.X,char.HumanoidRootPart.CFrame.Y,char.HumanoidRootPart.CFrame.Z), Vector3.new(part.CFrame.p.X,char.HumanoidRootPart.CFrame.p.Y,part.CFrame.p.Z))
  42.             end
  43.         end  
  44.     end)
  45. end
  46.  
  47. spawn(cameraChanged)
  48. wait()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement