Advertisement
SigmaBoy456

Roblox Example 461 Tween, Magnitude

Aug 21st, 2024
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. local player = game.Players.LocalPlayer
  2. local character = player.Character
  3. local localroot = character:WaitForChild("HumanoidRootPart")
  4. local tw = game:GetService("TweenService")
  5. local info = TweenInfo.new(0.5)
  6.  
  7. while wait(0.1) do
  8. for _, v in pairs(game.Workspace:GetDescendants()) do
  9. if v.Name == "CK" then
  10. local distance = (localroot.Position - v.Position).magnitude
  11. if distance < 100 then
  12. local Tween = tw:Create(v, info, {CFrame = localroot.CFrame})
  13. Tween:Play()
  14. Tween.Completed:Wait()
  15. end
  16. end
  17. end
  18. end
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement