Advertisement
ConTheKoala

Heavy minigun

Mar 25th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.41 KB | None | 0 0
  1. local Player = game:GetService("Players").LocalPlayer
  2. local Character = Player.Character
  3. local Mouse = Player:GetMouse()
  4. --Mouse.TargetFilter = workspace
  5.  
  6. local Head = Character:WaitForChild("Head")
  7. local Torso = Character:WaitForChild("Torso")
  8. local RootPart = Character:WaitForChild("HumanoidRootPart")
  9. local Human = Character:WaitForChild("Humanoid")
  10.  
  11. Human.AutoRotate = false
  12. Human.JumpPower = 0
  13. Human.WalkSpeed = 12
  14.  
  15. -----------------------------------------------------------------------------------------------------------------------
  16.  
  17. for _, Item in next, Character:GetChildren() do
  18. if Item:IsA("CharacterAppearance") then
  19. Item:Destroy()
  20. end
  21. end
  22.  
  23.  
  24.  
  25. --[[local BodyColors = Character:WaitForChild("Body Colors")
  26. BodyColors.HeadColor = BrickColor.new("Light orange")
  27. BodyColors.LeftArmColor = BrickColor.new("Light orange")
  28. BodyColors.RightArmColor = BrickColor.new("Light orange")
  29. BodyColors.TorsoColor = BrickColor.new("Light orange")--]]
  30.  
  31. spawn(function() wait(.5)
  32. Head.BrickColor = BrickColor.new("Light orange")
  33. Torso.BrickColor = BrickColor.new("Light orange")
  34. Character["Left Arm"].BrickColor = BrickColor.new("Light orange")
  35. Character["Right Arm"].BrickColor = BrickColor.new("Light orange")
  36. end)
  37.  
  38. Character:WaitForChild("Animate"):Destroy()
  39.  
  40. local RJ = RootPart:WaitForChild("RootJoint")
  41. RJ:Destroy()
  42. RJ = Instance.new("Weld", RootPart)
  43. RJ.Part0 = RootPart
  44. RJ.Part1 = Torso
  45.  
  46. local Neck = Instance.new("Weld", Torso)
  47. Neck.Part0 = Torso
  48. Neck.Part1 = Character:WaitForChild("Head")
  49. Neck.C0 = CFrame.new(0, 1.5, 0)
  50.  
  51. Torso:WaitForChild("Right Shoulder").Part1 = nil
  52. local RS = Instance.new("Weld", Head)
  53. RS.Part0 = Head
  54. RS.Part1 = Character:WaitForChild("Right Arm")
  55.  
  56. Torso:WaitForChild("Left Shoulder").Part1 = nil
  57. local LS = Instance.new("Weld", Head)
  58. LS.Part0 = Head
  59. LS.Part1 = Character:WaitForChild("Left Arm")
  60.  
  61. local LH = Torso:WaitForChild("Left Hip")
  62. LH:Destroy()
  63. LH = Instance.new("Weld", Torso)
  64. LH.Part0 = Torso
  65. LH.Part1 = Character:WaitForChild("Left Leg")
  66.  
  67. local RH = Torso:WaitForChild("Right Hip")
  68. RH:Destroy()
  69. RH = Instance.new("Weld", Torso)
  70. RH.Part0 = Torso
  71. RH.Part1 = Character:WaitForChild("Right Leg")
  72.  
  73. local GUN = Instance.new("Part", Character)
  74. GUN.CanCollide = false
  75. GUN.Size = Vector3.new(1.549, 2.302, 3.814)
  76. GUN.Name = "Handle"
  77. GUN.Material = Enum.Material.SmoothPlastic
  78.  
  79. local MS = Instance.new("SpecialMesh", GUN)
  80. MS.MeshType = Enum.MeshType.FileMesh
  81. MS.MeshId = "rbxassetid://450812185"
  82. MS.TextureId = "rbxassetid://450812194"
  83.  
  84. local GRIP = Instance.new("Weld", RS.Part1)
  85. GRIP.Part0 = RS.Part1
  86. GRIP.Part1 = GUN
  87.  
  88. local SN = Instance.new("Sound", GUN)
  89. SN.SoundId = "rbxassetid://341294387"
  90. SN.PlaybackSpeed = 0.9
  91. SN.Looped = true
  92. SN.Volume = 0
  93. SN:Play()
  94.  
  95. local FL = Instance.new("Part", GUN)
  96. FL.BrickColor = BrickColor.Yellow()
  97. FL.Transparency = 1
  98. FL.Material = Enum.Material.SmoothPlastic
  99. FL.CanCollide = false
  100. FL.Size = Vector3.new(1, 3.38, 1)
  101.  
  102. local MS2 = Instance.new("SpecialMesh", FL)
  103. MS2.MeshType = Enum.MeshType.FileMesh
  104. MS2.MeshId = "rbxassetid://1323306"
  105. MS2.Scale = Vector3.new(0.35, 1.9, 0.35)
  106.  
  107. local FLW = Instance.new("Weld", GUN)
  108. FLW.Part0 = GUN
  109. FLW.Part1 = FL
  110. FLW.C0 = CFrame.new(0.293, 0.251, 3.221, 0, 0.028, 1, 1, 0, 0, 0, 1, -0.028)
  111.  
  112. -----------------------------------------------------------------------------------------------------------------------
  113.  
  114. local STANCE = {
  115. NK = CFrame.new(0, 1, 0, 0.747311652, 0, 0.664473772, 0, 1, 0, -0.664473772, 0, 0.747311652);
  116. RJ = CFrame.new(0, 0, 0, 0.747311592, 0, -0.664473712, 0, 1, 0, 0.664473712, 0, 0.747311592);
  117. LS = CFrame.new(0.474761963, -1.61745477, -1.20455933, -0.127145067, -0.88503027, -0.447834671, -0.836402416, 0.338357687, -0.431213528, 0.533165276, 0.319743276, -0.783262014);
  118. RS = CFrame.new(1.14480591, -1.47239065, 0.695491791, 0.972185493, -0.190045089, -0.136889026, 0.123703048, 0.912935674, -0.388903707, 0.198880106, 0.361152887, 0.911051929);
  119. GRIP = CFrame.new(-0.0976009369, -1.92251587, -1.31733322, -0.980839312, 0.117544398, -0.155363142, 0.158846945, 0.944226265, -0.288452089, 0.11279203, -0.307604104, -0.944805682);
  120. }
  121.  
  122. LS.C0 = STANCE.LS
  123. RS.C0 = STANCE.RS
  124. RJ.C0 = STANCE.RJ
  125. GRIP.C0 = STANCE.GRIP
  126.  
  127. local Down = false
  128.  
  129. Mouse.Button1Down:Connect(function()
  130. Down = true
  131. end)
  132.  
  133. Mouse.Button1Up:Connect(function()
  134. Down = false
  135. end)
  136.  
  137. math.randomseed(os.time())
  138.  
  139. local function Taunt()
  140. local Taunts = {137542750, 130774824, 130776108, 679798995, 679798810}
  141. local Sound = Instance.new("Sound", GUN)
  142. local Id = Taunts[math.random(#Taunts)]
  143. Sound.TimePosition = Id == 130776108 and 4.2 or 0
  144. Sound.SoundId = "rbxassetid://" .. Id
  145. Sound.Volume = 1
  146. Sound.Ended:Connect(function()
  147. Sound:Destroy()
  148. end)
  149. Sound:Play()
  150. end
  151.  
  152. Mouse.KeyDown:Connect(function(Key)
  153. if Key == string.char(32) then
  154. Taunt()
  155. end
  156. end)
  157.  
  158.  
  159.  
  160. local function Shoot()
  161. local Bullet = Instance.new("Part")
  162. Bullet.Size = Vector3.new(0.3, 0.3, 0.7)
  163. Bullet.Transparency = 1
  164. Bullet.CanCollide = false
  165.  
  166. local AntiGravity = Instance.new("BodyForce", Bullet)
  167. AntiGravity.Force = Vector3.new(0, Bullet:GetMass() * workspace.Gravity, 0)
  168.  
  169. local Start = (GUN.CFrame * CFrame.new(0.255, 0.251, 1.877)).p
  170. Bullet.CFrame = CFrame.new(Start, Mouse.Hit.p)
  171. Bullet.Velocity = Bullet.CFrame.lookVector * 300
  172.  
  173. Bullet.Touched:Connect(function(Hit)
  174. if Hit.Parent and Hit.Parent ~= Character and Hit.Parent:FindFirstChild("Humanoid") then
  175. Hit.Parent.Humanoid:TakeDamage(5)
  176. Bullet:Destroy()
  177. end
  178. end)
  179.  
  180. Bullet.Parent = workspace
  181. game.Debris:AddItem(Bullet, 3)
  182. end
  183.  
  184.  
  185. game:GetService("RunService"):BindToRenderStep("Invisible", Enum.RenderPriority.Character.Value - 1, function()
  186. GUN.LocalTransparencyModifier = 0
  187. FL.LocalTransparencyModifier = 0
  188. LS.Part1.LocalTransparencyModifier = 0
  189. RS.Part1.LocalTransparencyModifier = 0
  190. end)
  191.  
  192. local Heartbeat, Angle = game:GetService("RunService").Heartbeat
  193.  
  194. while Heartbeat:Wait() do
  195. local Angle = tick() * 8
  196.  
  197. -- Torso lean
  198. local VelocityForTilt = RootPart.Velocity * Vector3.new(1, 0, 1) / 150
  199. local VectorForTilt = RootPart.CFrame:vectorToObjectSpace(VelocityForTilt)
  200. RJ.C0 = RJ.C0:Lerp(STANCE.RJ * CFrame.Angles(VectorForTilt.Z, VectorForTilt.X, -VectorForTilt.X), 0.1)
  201.  
  202. -- Rotate to face camera
  203. local RootPosition = RootPart.Position
  204. local Direction = Mouse.Hit.p - RootPosition
  205. Direction = Vector3.new(Direction.X, 0, Direction.Z).unit
  206. local NewCFrame = CFrame.new(RootPosition, RootPosition + Direction) * CFrame.Angles(0, -0.02, 0)
  207. RootPart.CFrame = RootPart.CFrame:Lerp(NewCFrame, 0.1)
  208.  
  209. -- Neck Angle
  210. local Hypotenuse = (Mouse.Hit.p - Head.Position).magnitude
  211. local Opposite = Mouse.Hit.p.y - Head.Position.y
  212. local Pitch = math.asin(Opposite / Hypotenuse)
  213. local NewNeckCFrame = STANCE.NK * CFrame.Angles(Pitch + 0.2, 0, 0) * CFrame.new(0, 0.5, 0)
  214. Neck.C0 = Neck.C0:Lerp(NewNeckCFrame, 0.1)
  215.  
  216. -- Legs
  217. local FlatVelocity = (Torso.Velocity * Vector3.new(1, 0, 1))
  218. if FlatVelocity.magnitude < 2 then
  219. LH.C0 = LH.C0:Lerp(CFrame.new(-0.5, -1, 0) * CFrame.Angles(math.sin(tick() * 0.5) / 17, 0, -0.02 + math.sin(tick() * 0.4) / 19) * CFrame.new(0, -1, 0), 0.2)
  220. RH.C0 = RH.C0:Lerp(CFrame.new(0.5, -1, 0) * CFrame.Angles(math.sin(-tick() * 0.5) / 18, 0, 0.02 + math.sin(-tick() * 0.35) / 20) * CFrame.new(0, -1, 0), 0.2)
  221. else
  222. local Look = (Torso.CFrame.lookVector * Vector3.new(1, 0, 1)).unit
  223. local Move = FlatVelocity.unit
  224. local OffAngle = (Look:Cross(Move).Y > 0 and 1 or -1) * math.acos(1 - (Look - Move).magnitude ^ 2 / 2)
  225. OffAngle = math.max(-math.pi, math.min(math.pi, OffAngle))
  226. LH.C0 = LH.C0:Lerp(CFrame.new(-0.5, 0, 0) * CFrame.Angles(0, OffAngle, 0)
  227. * CFrame.new(0, -math.max(0, math.cos(Angle * 2) / 5) + math.max(0, math.cos(Angle + math.pi) / 2.5) - 2, math.sin(-Angle + math.pi) / 1.8 + 0.15)
  228. * CFrame.Angles(math.sin(-Angle) / 1.8 - 0.2, 0, 0), 0.2)
  229. RH.C0 = RH.C0:Lerp(CFrame.new(0.5, 0, 0) * CFrame.Angles(0, OffAngle, 0)
  230. * CFrame.new(0, -math.max(0, math.cos(Angle * 2) / 5) + math.max(0, math.cos(Angle) / 2.5) - 2, math.sin(-Angle) / 1.8 + 0.15)
  231. * CFrame.Angles(math.sin(Angle) / 1.8 - 0.2, 0, 0), 0.2)
  232. end
  233.  
  234. -- Shooting
  235. if Down then
  236. SN.Volume = SN.Volume + (1.5 - SN.Volume) * 0.3
  237. FL.Transparency = FL.Transparency + (0.6 - FL.Transparency) * 0.2
  238. FLW.C0 = FLW.C0 * CFrame.Angles(0, 0.2, 0)
  239. Shoot()
  240. else
  241. SN.Volume = SN.Volume + (0 - SN.Volume) * 0.15
  242. FL.Transparency = FL.Transparency + (1 - FL.Transparency) * 0.2
  243. end
  244. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement