Advertisement
Guest User

Untitled

a guest
Dec 22nd, 2014
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. local workspace = game.Workspace
  2. local spawnPoint = workspace.Part
  3.  
  4. local x = Instance.new("IntValue")
  5. x.Parent = game.Lighting.Configuration
  6. x.Name = "Value"
  7.  
  8. function spawnBlocks(times)
  9. for z = 1, times do
  10. local block = Instance.new("Part")
  11. block.Parent = workspace
  12. block.Size = Vector3.new(3, 3, 3)
  13. block.Position = spawnPoint.Position
  14. block.Name = x.Value
  15. wait(0.25)
  16. end
  17. end
  18.  
  19. function weldTheParts()
  20. -- Required variables
  21. local vertices = workspace.Model
  22. local cube = workspace.alpha
  23. local cubes = vertices:GetChildren()
  24.  
  25. if (cube.Anchored == false) and (cubes.Anchored == false) then
  26. cube.Anchored = true
  27. cubes.Anchored = true
  28. end
  29.  
  30. for _,Part in next,vertices:GetChildren() do
  31. local weld = Instance.new("ManualWeld")
  32. weld.Part0 = cube
  33. weld.Part1 = Part
  34. weld.C0 = CFrame.new()
  35. weld.C1 = Part.CFrame:inverse() * cube.CFrame
  36. weld.Parent = cube
  37. end
  38.  
  39. cube.Anchored = false
  40. cubes.Anchored = false
  41. end
  42.  
  43. weldTheParts()
  44. spawnBlocks(500)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement