SebTDZ

Untitled

Jul 8th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.82 KB | None | 0 0
  1. local character = game.Players.SebCamBot.Character
  2. -- Get the head
  3. local head = character:FindFirstChild("Head")
  4. while true do
  5.     -- Build a ray in the direction the head is facing
  6.     local origin = head.Position
  7.     local lookDirection = head.CFrame.lookVector
  8.     local ray = Ray.new(origin, lookDirection * 500)
  9.     -- Raycast, ignoring the player's character
  10.     local part, hitPosition = workspace:FindPartOnRay(ray, character)
  11.     if part then
  12.         if part.Name == "Base" then
  13.             local a = 1
  14.         else
  15.             local Part = part
  16.             local Body = Instance.new("BodyPosition")
  17.             Body.Parent = Part
  18.             Body.Position = Part.Position + Vector3.new(0, 25, 0)
  19.             Body. MaxForce = Vector3.new(250000000000000000000000, 250000000000000000000000, 250000000000000000000000)
  20.             Part.Anchored = false
  21.             Part.CanCollide = false
  22.         end
  23.     end
  24.     wait(0.1)
  25. end
Add Comment
Please, Sign In to add comment