Advertisement
mathmasterphil

Pistols

Mar 7th, 2015
318
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.37 KB | None | 0 0
  1. me = game.Players.LocalPlayer
  2.  
  3. t = Instance.new("Tool", me.Backpack) -- Creates the tool
  4. t.Name = "Platform"
  5.  
  6. function Weld(a, b, c, d, e, f, g, h)
  7.         local w = Instance.new("Weld", a)
  8.         w.Part0 = a
  9.         w.Part1 = b
  10.         w.C1 = CFrame.new(c, d, e) * CFrame.Angles(f, g, h)
  11.         return w
  12. end
  13.  
  14. p = Instance.new("Part", t) -- Handle
  15. p.Name = "Handle"
  16. p.BrickColor = BrickColor.new("Really black")
  17. p.FormFactor = 3
  18. p.Size = Vector3.new(0.1, 0.1, 2)
  19. p.TopSurface = 0
  20. p.BottomSurface = 0
  21.  
  22. lnp = Instance.new("Part", t) -- Long Part
  23. lnp.BrickColor = p.BrickColor
  24. lnp.FormFactor = 3
  25. lnp.Size = Vector3.new(0.1, 2.5, 0.1)
  26. lnp.TopSurface = 0
  27. lnp.BottomSurface = 0
  28.  
  29. lp1 = Instance.new("Part", t) -- Low Part 1
  30. lp1.BrickColor = p.BrickColor
  31. lp1.FormFactor = 3
  32. lp1.Size = Vector3.new(3, 0.1, 0.1)
  33. lp1.TopSurface = 0
  34. lp1.BottomSurface = 0
  35.  
  36. lp2 = Instance.new("Part", t) -- Low Part 2
  37. lp2.BrickColor = p.BrickColor
  38. lp2.FormFactor = 3
  39. lp2.Size = Vector3.new(0.1, 0.1, 5)
  40. lp2.TopSurface = 0
  41. lp2.BottomSurface = 0
  42.  
  43. lp3 = Instance.new("Part", t) -- Low Part 3
  44. lp3.BrickColor = p.BrickColor
  45. lp3.FormFactor = 3
  46. lp3.Size = Vector3.new(0.1, 0.1, 5)
  47. lp3.TopSurface = 0
  48. lp3.BottomSurface = 0
  49.  
  50. lp4 = Instance.new("Part", t) -- Low Part 4
  51. lp4.BrickColor = p.BrickColor
  52. lp4.FormFactor = 3
  53. lp4.Size = Vector3.new(3, 0.1, 0.1)
  54. lp4.TopSurface = 0
  55. lp4.BottomSurface = 0
  56.  
  57. l1 = Instance.new("Part", t) -- Leg 1
  58. l1.BrickColor = p.BrickColor
  59. l1.FormFactor = 3
  60. l1.Size = Vector3.new(3, 1, 0.1)
  61. l1.TopSurface = 0
  62. l1.BottomSurface = 0
  63. l1.Transparency = 1
  64. l1.CanCollide = false
  65.  
  66. l2 = Instance.new("Part", t) -- Leg 2
  67. l2.BrickColor = p.BrickColor
  68. l2.FormFactor = 3
  69. l2.Size = Vector3.new(0.1, 1, 5)
  70. l2.TopSurface = 0
  71. l2.BottomSurface = 0
  72. l2.Transparency = 1
  73. l2.CanCollide = false
  74.  
  75. l3 = Instance.new("Part", t) -- Leg 3
  76. l3.BrickColor = p.BrickColor
  77. l3.FormFactor = 3
  78. l3.Size = Vector3.new(0.1, 1, 5)
  79. l3.TopSurface = 0
  80. l3.BottomSurface = 0
  81. l3.Transparency = 1
  82. l3.CanCollide = false
  83.  
  84. l4 = Instance.new("Part", t) -- Leg 4
  85. l4.BrickColor = p.BrickColor
  86. l4.FormFactor = 3
  87. l4.Size = Vector3.new(3, 1, 0.1)
  88. l4.TopSurface = 0
  89. l4.BottomSurface = 0
  90. l4.Transparency = 1
  91. l4.CanCollide = false
  92.  
  93. np = Instance.new("Part", t) -- New Part
  94. np.BrickColor = p.BrickColor
  95. np.FormFactor = 3
  96. np.Size = Vector3.new(3, 0.1, 5)
  97. np.TopSurface = 0
  98. np.BottomSurface = 0
  99. np.Transparency = 1
  100. np.CanCollide = false
  101.  
  102. Weld(p, lnp, 0, 1.2, 0.9, 0, 0, 0)
  103. Weld(p, lp1, 1.4, 2.4, 0.9, 0, 0, 0)
  104. Weld(p, lp2, 2.8, 2.4, -1.5, 0, 0, 0)
  105. Weld(p, lp3, 0, 2.4, -1.5, 0, 0, 0)
  106. Weld(p, lp4, 1.4, 2.4, -4, 0, 0, 0)
  107. Weld(p, l1, 1.4, 3, 0.9, 0, 0, 0)
  108. Weld(p, l2, 2.8, 3, -1.5, 0, 0, 0)
  109. Weld(p, l3, 0, 3, -1.5, 0, 0, 0)
  110. Weld(p, l4, 1.4, 3, -4, 0, 0, 0)
  111. Weld(p, np, 1.4, 3.4, -1.5, 0, 0, 0)
  112.  
  113. more = false
  114.  
  115. function Equipped(mouse) -- Equip!!
  116.         mouse.Button1Down:connect(
  117.                 function()
  118.                         more = true
  119.                         coroutine.resume(
  120.                         coroutine.create(
  121.                                 function()
  122.                                         repeat
  123.                                                 local newp = np:Clone()
  124.                                                 newp.Parent = Workspace
  125.                                                 newp.Anchored = true
  126.                                                 newp.Transparency = 0
  127.                                                 l1.Transparency = 0.5
  128.                                                 l2.Transparency = 0.5
  129.                                                 l3.Transparency = 0.5
  130.                                                 l4.Transparency = 0.5
  131.                                                 newp.CanCollide = true
  132.                                                 wait()
  133.                                         until not (more)
  134.                                         l1.Transparency = 1
  135.                                         l2.Transparency = 1
  136.                                         l3.Transparency = 1
  137.                                         l4.Transparency = 1
  138.                                 end
  139.                         )
  140.                         )
  141.                 end
  142.         )
  143.         mouse.Button1Up:connect(
  144.                 function()
  145.                         more = false
  146.                 end
  147.         )
  148. end
  149.  
  150. t.Equipped:connect(Equipped)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement