EpicZombie226_YT

spooky script boi (roblox studio)

Dec 28th, 2018
389
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. --//By rokec123
  2.  
  3. --//Variables
  4. local head = script.Parent
  5. local Body_Gyro = head.BodyGyro
  6. local Body_Position = head.BodyPosition
  7. local studsAway = 10
  8.  
  9. --//Set Body Position
  10. Body_Position.Position = head.CFrame.p
  11.  
  12. --//Main Code
  13. while wait() do
  14. for _, v in pairs(game.Players:GetPlayers()) do
  15. local character = workspace:WaitForChild(v.Name)
  16. if character then
  17. local distance = (head.CFrame.p - character.PrimaryPart.CFrame.p).Magnitude
  18. if distance <= studsAway then
  19. Body_Gyro.CFrame = CFrame.new(head.CFrame.p, character.PrimaryPart.CFrame.p)
  20. break
  21. else
  22. Body_Gyro.CFrame = CFrame.new(head.CFrame.p, script.Parent.Parent.Parent.Look.CFrame.p)
  23. end
  24. end
  25. end
  26. end
Advertisement
Add Comment
Please, Sign In to add comment