IHATEMICROWAVEOVEN

old facing (uses BodyGyro)

Jul 8th, 2021 (edited)
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. function Use(...)
  2. local args = {...}
  3. local nearestdistance = math.huge
  4. local nearestplayer
  5. for _, i in pairs(game.Players:GetPlayers()) do
  6. local distancecheck = i:DistanceFromCharacter(args[1].Torso.Position)
  7. if distancecheck < nearestdistance then
  8. nearestplayer = i
  9. nearestdistance = distancecheck
  10. end
  11. end
  12. local bg = Instance.new("BodyGyro")
  13. bg.Parent = args[1].Torso
  14. bg.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
  15. bg.CFrame = CFrame.new(args[1].Torso.Position, nearestplayer.Character.Torso.Position)
  16. wait(3) -- placeholder to show you it does the thing
  17. bg:Destroy() -- kill the facing so it doesnt walk around like that
  18. end
  19.  
  20. return Use
Add Comment
Please, Sign In to add comment