c00lkiddv2016

Lego

Jun 16th, 2016
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.67 KB | None | 0 0
  1. local Player = game:GetService("Players").LocalPlayer
  2. local Character = Player.Character
  3. local Torso = Character.Torso
  4.  
  5. ca=CFrame.Angles
  6. cn=CFrame.new
  7. it=Instance.new
  8. rd=math.rad
  9. v3=Vector3.new
  10.  
  11. Interpolate = function(CFrame1, CFrame2)
  12. local Table1 = {CFrame1:components()}
  13. local Table2 = {CFrame2:components()}
  14. local NewCFrame = {}
  15. for i,v in ipairs(Table1) do
  16. local Difference = Table2[i] - v
  17. if i < 4 then
  18. local NewValue
  19. if math.abs(Difference) < 0.1 then
  20. NewValue = Table2[i]
  21. else
  22. NewValue = v + ((Difference/math.abs(Difference)) * 0.1)
  23. end
  24. NewCFrame[i] = NewValue
  25. else
  26. local NewValue
  27. if math.abs(Difference) < 0.1 then
  28. NewValue = Table2[i]
  29. else
  30. NewValue = v + ((Difference/math.abs(Difference)) * 0.1)
  31. end
  32. NewCFrame[i] = NewValue
  33. end
  34. end
  35. return CFrame.new(unpack(NewCFrame))
  36. end
  37.  
  38. Prop = function(Parent, Name, x, y, z, Anchored, CanCollide, Color)
  39. local Part = Instance.new("Part",Parent)
  40. Part.Name = Name
  41. Part.FormFactor = 3
  42. Part.Size = Vector3.new(x, y, z)
  43. Part.Anchored = Anchored
  44. Part.CanCollide = CanCollide
  45. Part.BrickColor = BrickColor.new(Color)
  46. Part.TopSurface = 0
  47. Part.BottomSurface = 0
  48. Part:BreakJoints()
  49. return Part
  50. end
  51.  
  52. Mesh = function(Parent, MeshType,x, y, z,MeshId,TextureId)
  53. local Mesh = nil
  54. if MeshType=="CylinderMesh" then
  55. Mesh=Instance.new("CylinderMesh",Parent)
  56. Mesh.Scale=Vector3.new(x,y,z)
  57. elseif MeshType~="BlockMesh" and MeshType~="CylinderMesh" then
  58. Mesh=Instance.new("SpecialMesh",Parent)
  59. Mesh.MeshType = MeshType
  60. Mesh.MeshId = MeshId or ""
  61. Mesh.Scale = Vector3.new(x, y, z)
  62. return Mesh
  63. end
  64. end
  65.  
  66. Weld = function(Part0, Part1, C0, C1)
  67. local Weld = Instance.new("Weld",Part0)
  68. Weld.Part0 = Part0
  69. Weld.Part1 = Part1
  70. Weld.C0 = C0 or CFrame.new()
  71. Weld.C1 = C1 or CFrame.new()
  72. return Weld
  73. end
  74.  
  75. local Handle = Prop(Character, "Handle", 0.2, 1.5, 0.2, false, false, "Really black")
  76. Weld(Torso, Handle, CFrame.new(0, 5, 0))
  77. local Guard = Prop(Character, "Guard", 1.5,0.1,0.2,false, false, "Really black")
  78. Weld(Handle, Guard, CFrame.new(0, 1.5/2, 0))
  79. local Pivot = Prop(Character,"",0,0,0,false,false,"") -- this is basicly an invisible part
  80. local Pivot2 = Prop(Character,"",0,0,0,false,false,"")
  81. Pivot.Transparency = 1
  82. Pivot2.Transparency = 1
  83. Weld(Guard,Pivot,CFrame.new(0,-0.75,0)*CFrame.Angles(0,0,math.rad(-40-90)))
  84. Weld(Guard,Pivot2,CFrame.new(0,0.75,0)*CFrame.Angles(0,0,math.rad(40+90)))
  85. local Guard2 = Prop(Character, "Guard2", 0.1, 0.5, 0.2, false, false, "Really black")
  86. Weld(Pivot, Guard2, CFrame.new(0, -0.25, 0))
  87. local Guard3 = Prop(Character, "Guard3", 0.1, 0.5, 0.2, false, false, "Really black")
  88. Weld(Pivot2, Guard3, CFrame.new(0, 0.25, 0))
  89. local Design = Prop(Character, "Design", 0.5, 1, 0.5, false, false, "Gold")
  90. Mesh(Design, "FileMesh", 0.5, 1, 0.5,"http://www.roblox.com/Asset/?id=9756362")
  91. Weld(Handle, Design, CFrame.new(0, -0.75, 0))
  92. local Ball = Prop(Character, "Ball1", 0.3, 0.3, 0.3, false, false, "Gold")
  93. Mesh(Ball, "Sphere", 1, 1, 1)
  94. Weld(Pivot, Ball)
  95. local Ball2 = Prop(Character, "Ball2", 0.3, 0.3, 0.3, false, false, "Gold")
  96. Mesh(Ball2, "Sphere", 1, 1, 1)
  97. Weld(Pivot2, Ball2)
  98. local Spike = Prop(Character, "Spike1", 0.1, 1, 0.1, false, false, "Gold")
  99. Mesh(Spike, "FileMesh", 0.1, 1, 0.1,"http://www.roblox.com/asset/?id=1033714")
  100. Weld(Pivot, Spike, CFrame.new(-0.3, 0, 0) * CFrame.Angles(math.rad(0), 0, math.rad(90)))
  101. local Spike2 = Prop(Character, "Spike2", 0.1, 1, 0.1, false, false, "Gold")
  102. Mesh(Spike2, "FileMesh", 0.1, 1, 0.1, "http://www.roblox.com/asset/?id=1033714")
  103. Weld(Pivot2, Spike2, CFrame.new(-0.3, 0, 0) * CFrame.Angles(math.rad(0), 0, math.rad(90)))
  104. Mesh(Handle, "CylinderMesh", 1, 1, 1)
Add Comment
Please, Sign In to add comment