EFTPMC

Minigun

Nov 15th, 2020
4,149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.83 KB | None | 0 0
  1. game["Run Service"].RenderStepped:connect(function()
  2. settings().Physics.AllowSleep = false
  3. setsimulationradius(math.huge*math.huge,math.huge*math.huge)
  4. end)
  5.  
  6. plr = game.Players.LocalPlayer
  7. dead = false
  8. char = plr.Character
  9.  
  10. gun = char["Juggernaut's Chaingun"]
  11. ghandle = gun.Handle
  12. ghandle.AccessoryWeld:Destroy()
  13.  
  14. bullet = char["RockAccessory"]
  15. bhandle = bullet.Handle
  16. bhandle.SpecialMesh:Destroy()
  17. wait()
  18. bullet.Parent = workspace
  19.  
  20. mouse = plr:GetMouse()
  21. head = char.Head
  22. camera = workspace.CurrentCamera
  23. lt = true
  24. ltt = false
  25.  
  26. local function IsFirstPerson()
  27. return (head.CFrame.p - camera.CFrame.p).Magnitude < 1
  28. end
  29.  
  30. bbv = Instance.new("BodyVelocity",bhandle)
  31.  
  32. rarm = char["Right Arm"]
  33. larm = char["Left Arm"]
  34. torso = char.Torso
  35.  
  36. torso["Right Shoulder"]:Destroy()
  37. torso["Left Shoulder"]:Destroy()
  38.  
  39. larm.LeftShoulderAttachment:Destroy()
  40. rarm.RightShoulderAttachment:Destroy()
  41.  
  42. l = Instance.new("Attachment",larm)
  43. l.Rotation = Vector3.new(-90,20,0)
  44. l.Position = Vector3.new(1,1,0.5)
  45.  
  46. r = Instance.new("Attachment",rarm)
  47. r.Rotation = Vector3.new(-3290,-2545,0)
  48. r.Position = Vector3.new(-1,0.5,0.5)
  49.  
  50. t = Instance.new("Attachment",torso)
  51. --rarm
  52. rap = Instance.new("AlignPosition",rarm)
  53. rap.Attachment0 = r
  54. rap.Attachment1 = t
  55. rap.RigidityEnabled = true
  56.  
  57. rao = Instance.new("AlignOrientation",rarm)
  58. rao.Attachment0 = r
  59. rao.Attachment1 = t
  60. rao.RigidityEnabled = true
  61.  
  62. --larm
  63.  
  64.  
  65.  
  66.  
  67. lap = Instance.new("AlignPosition",larm)
  68. lap.Attachment0 = l
  69. lap.Attachment1 = t
  70. lap.RigidityEnabled = false
  71.  
  72. lao = Instance.new("AlignOrientation",larm)
  73. lao.Attachment0 = l
  74. lao.Attachment1 = t
  75. lao.RigidityEnabled = false
  76.  
  77. -- gun
  78.  
  79. h = Instance.new("Attachment",ghandle)
  80. h.Rotation = Vector3.new(90,-130,50)
  81. h.Position = Vector3.new(1,0,0.5)
  82.  
  83. lg = Instance.new("Attachment",larm)
  84. lg.Rotation = Vector3.new(1,-5,-5)
  85. lg.Position = Vector3.new(0,0,0)
  86.  
  87. gap = Instance.new("AlignPosition",ghandle)
  88. gap.Attachment0 = h
  89. gap.Attachment1 = lg
  90. gap.RigidityEnabled = true
  91.  
  92. gao = Instance.new("AlignOrientation",ghandle)
  93. gao.Attachment0 = h
  94. gao.Attachment1 = lg
  95. gao.RigidityEnabled = true
  96.  
  97.  
  98. mouse.Button1Down:Connect(function()
  99. if dead == false then
  100. lt = false
  101. ltt = true
  102.  
  103. -- whats causing problems with rotation
  104. h.Rotation = Vector3.new(90,-130,50)
  105.  
  106. l.Position = Vector3.new(1,0.5,0.5)
  107. l.Rotation = Vector3.new(-95,25,0)
  108.  
  109. wait(0.13)
  110. h.Rotation = Vector3.new(90,-130,50)
  111.  
  112. l.Position = Vector3.new(1,1,0.2)
  113. l.Rotation = Vector3.new(-90,20,-10)
  114.  
  115. r.Position = Vector3.new(-1,0.5,0.5)
  116. r.Rotation = Vector3.new(-90,-35,0)
  117. ltt = false
  118. bbav = Instance.new("BodyAngularVelocity",bhandle)
  119. bbav.MaxTorque = Vector3.new(math.huge,math.huge,math.huge)
  120. bbav.P = 1000000000000000000000000000
  121. bbav.AngularVelocity = Vector3.new(10000000000000000000000000000000,100000000000000000000000000,100000000000000000)
  122. if game.Players:GetPlayerFromCharacter(mouse.Target.Parent) then
  123. repeat
  124. game:GetService("RunService").RenderStepped:Wait()
  125.  
  126. wait(0.23)
  127. until char.Humanoid.Health == 100 or char.Humanoid.Health == 0
  128. elseif game.Players:GetPlayerFromCharacter(mouse.Target.Parent.Parent) then
  129. repeat
  130. game:GetService("RunService").RenderStepped:Wait()
  131. bhandle.Position = mouse.Target.Parent.Parent.HumanoidRootPart.CFrame.p
  132. wait(0.23)
  133. until char.Humanoid.Health == 100 or char.Humanoid.Health == 0
  134.  
  135. else
  136. repeat
  137. game:GetService("RunService").RenderStepped:Wait()
  138. bhandle.Position = mouse.Hit.p
  139. wait(0.23)
  140. until char.Humanoid.Health == 100 or char.Humanoid.Health == 0
  141. end
  142. wait()
  143. lt = true
  144. end
  145. end)
  146.  
  147. char.Humanoid.Died:Connect(function()
  148. dead = true
  149. end)
  150. repeat
  151. game:GetService("RunService").RenderStepped:Wait()
  152. if dead == false and bhandle.CanCollide == true then
  153. bhandle.CanCollide = false
  154. end
  155. if lt == true and dead == false then
  156. bhandle.CFrame = char.Head.CFrame * CFrame.new(0,-10,0)
  157. elseif ltt == true and dead == false then
  158. bhandle.CFrame = ghandle.CFrame * CFrame.new(0,0,-3)
  159. bhandle.Rotation = char.HumanoidRootPart.Rotation
  160. end
  161. until char.Humanoid.Health == 0
Add Comment
Please, Sign In to add comment