cuepointthekid

Untitled

Jun 25th, 2016
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. while true do
  2. local Number = 0
  3. local Max_Number = 250
  4. local Targets = {}
  5. local Bricks = game.Workspace:GetChildren()
  6. for X = 1, # Bricks do
  7. if Bricks[X].className == "Part" then
  8. if Bricks[X].Locked == false and Bricks[X].Anchored == false then
  9. table.insert(Targets, Bricks[X])
  10. local Origin = Instance.new("CFrameValue")
  11. Origin.Parent = Bricks[X]
  12. Origin.Name = "Origin CFrame"
  13. Origin.Value = Bricks[X].CFrame
  14. end
  15. end
  16. end
  17. while Number < Max_Number do
  18. for X = 1, # Targets do
  19. local History = Instance.new("CFrameValue")
  20. History.Parent = Targets[X]
  21. History.Name = Number
  22. History.Value = Targets[X].CFrame
  23. end
  24. Number = Number + 1
  25. wait()
  26. end
  27. while Number > 0 do
  28. Number = Number - 1
  29. wait()
  30. for X = 1, # Targets do
  31. local History = Targets[X]:findFirstChild(Number)
  32. if History ~= nil then
  33. Targets[X].CFrame = History.Value
  34. History:remove()
  35. end
  36. end
  37. end
  38. for X = 1, # Targets do
  39. local Origin = Targets[X]:findFirstChild("Origin CFrame")
  40. if Origin ~= nil then
  41. Targets[X].CFrame = Origin.Value
  42. Targets[X]:makeJoints()
  43. Origin:remove()
  44. end
  45. end
  46. Targets = {}
  47. end
Add Comment
Please, Sign In to add comment