SebTDZ

Track Test

Sep 13th, 2019
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.03 KB | None | 0 0
  1. for i=1,25 do
  2.     local fbdysg = Instance.new("Part",workspace)
  3.     fbdysg.Anchored = true
  4.     fbdysg.Position = Vector3.new(math.random(-500,500),math.random(25,100),math.random(-500,500))
  5. end
  6. owner = game.Players.TheOfficialSeb
  7. function add(p2)
  8.     local p1 = owner.Character.HumanoidRootPart
  9.     local NewPart = Instance.new("Part")
  10.     NewPart.Parent = workspace
  11.     NewPart.Material = "ForceField"
  12.     NewPart.Name = "Tracker"
  13.     NewPart.BrickColor = BrickColor.new("Bright blue")
  14.     NewPart.Anchored = true
  15.     NewPart.CanCollide = false
  16.     NewPart.Size = Vector3.new(0.25, 0.25, 0.25)
  17.     coroutine.resume(coroutine.create(function()
  18.         while p2.Parent ~= nil and p1 ~= nil do
  19.             local magnitude = (p2.Position - p1.Position).Magnitude
  20.             NewPart.Size = Vector3.new(0.25, 0.25, magnitude)
  21.             NewPart.CFrame = CFrame.new(p1.Position,p2.Position) * CFrame.new(0, 0, tonumber("-" .. string.format(magnitude/2)))
  22.             wait(0.005)
  23.         end
  24.         NewPart:Remove()
  25.     end))
  26. end
  27. for i,v in pairs(game.Workspace:GetChildren()) do
  28.     if v.ClassName == "Part" then
  29.         add(v)
  30.     end
  31. end
Add Comment
Please, Sign In to add comment