awzp

Knockback Gun Thing (not by me)

Jun 21st, 2018
436
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.41 KB | None | 0 0
  1.  
  2. -- [ No Time To Explain! ] --
  3. -- [ Burst Gun ] --
  4. wait()
  5. Music = true
  6. Player = game.Players.LocalPlayer
  7. c = game.Players.LocalPlayer.Character
  8. Head = c.Head
  9. anim = c.Humanoid.Animator
  10. Shot = false
  11. Battle = false
  12. p = game.Players.LocalPlayer
  13. Music = false
  14. PhaseEnabled = true
  15. TeleportEnabled = true
  16.  
  17. local Effects = {}
  18. attack = false
  19. local attacking = false
  20. vt = Vector3.new
  21. bc = BrickColor.new
  22. br = BrickColor.random
  23. it = Instance.new
  24. cf = CFrame.new
  25. euler = CFrame.fromEulerAnglesXYZ
  26. angles = CFrame.Angles
  27. matr = math.random
  28. mouse = Player:GetMouse()
  29.  
  30. c.Humanoid.WalkSpeed = 24 c.Humanoid.JumpPower = 50
  31. RA = c["Right Arm"]
  32. RSC0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  33. RSC1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  34. LSC0 = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  35. LSC1 = CFrame.new(0.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  36. RHC0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  37. RHC1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  38. LHC0 = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  39. LHC1 = CFrame.new(-0.5, 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  40. NC0 = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
  41. NC1 = CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
  42. RJC0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
  43. RJC1 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
  44. RS = c.Torso:FindFirstChild("Right Shoulder")
  45. LS = c.Torso:FindFirstChild("Left Shoulder")
  46. RH = c.Torso:FindFirstChild("Right Hip")
  47. LH = c.Torso:FindFirstChild("Left Hip")
  48. RJ = c.HumanoidRootPart:FindFirstChild("RootJoint")
  49. N = c.Torso:FindFirstChild("Neck")
  50. cf = CFrame.new
  51. ang = CFrame.Angles
  52. rd = math.rad
  53. rd2 = math.random
  54.  
  55. function swait(num)
  56. if num==0 or num==nil then
  57. game:service'RunService'.Heartbeat:wait(0)
  58. else
  59. for i=0,num do
  60. game:service'RunService'.Heartbeat:wait(0)
  61. end
  62. end
  63. end
  64.  
  65. local Music = Instance.new("Sound",c.HumanoidRootPart)Music.SoundId = "rbxassetid://359311553" Music.Volume = 0.5 Music.Looped = true Music:Play()
  66. RS.Name = "RightShoulds"
  67. RA2 = RA:clone() RA2.Name = "RightArm"
  68. RA.Parent = nil
  69. RS.Parent = nil
  70. wait()
  71. RA2.Parent = c
  72. RS = Instance.new("Motor6D",c.Torso)RS.Part0 = c.Torso RS.Part1 = RA2 RS.C0 = RSC0 RS.C1 = RSC1 RS.Name = "Right Shoulder"
  73. RSM = Instance.new("SpecialMesh",RA2)RSM.MeshId = "rbxassetid://430080097"
  74. local RightGun = Instance.new("Part",c)RightGun.Size = Vector3.new(0.4,1.4,4)RightGun.CanCollide = false RightGun.Anchored = false RightGun.Name = "BlastBow" RightGun.Archivable = false
  75. local RightM = Instance.new("SpecialMesh",RightGun)RightM.MeshId = "rbxassetid://477037714" RightM.TextureId = "rbxassetid://477037796" RightM.Scale = Vector3.new(0.06,0.04,0.02)
  76. local RightW = Instance.new("Weld",c["RightArm"])RightW.Part0 = c["RightArm"] RightW.Part1 = RightGun RightW.C0 = CFrame.new(0,-2,-0.25)*CFrame.Angles(math.rad(-90),0,0)
  77. local Hood = Instance.new("Part",c)Hood.Size = Vector3.new(0.2,0.2,0.2)Hood.Color = Color3.new(42/255,42/255,42/255)
  78. local HM = Instance.new("SpecialMesh",Hood)HM.MeshId = "rbxassetid://15393065" HM.Scale = Vector3.new(0.95,1,0.95)
  79. local HW = Instance.new("Weld",c.Head)HW.Part0 = c.Head HW.Part1 = Hood HW.C0 = CFrame.new(0,0.25,0)
  80. for _, c in pairs(c:children()) do
  81. if c.className == "Accessory" then
  82. c.Parent = nil
  83. end
  84. end
  85. c.Head.face:remove()
  86. local Rubble = Instance.new("Sound",c.HumanoidRootPart)Rubble.SoundId = "rbxassetid://172019967" Rubble.Volume = 0 Rubble.Looped = true
  87.  
  88. function lerpz(joint, prop, cfrmz, alp)
  89. joint[prop] = joint[prop]:lerp(cfrmz, alp)
  90. end
  91. function resetlerp()
  92. RJ.C0 = RJC0
  93. RJ.C1 = RJC1
  94. N.C0 = NC0
  95. N.C1 = NC1
  96. RS.C0 = RSC0
  97. RS.C1 = RSC1
  98. LS.C0 = LSC0
  99. LS.C1 = LSC1
  100. RH.C0 = RHC0
  101. RH.C1 = RHC1
  102. LH.C0 = LHC0
  103. LH.C1 = LHC1
  104. end
  105.  
  106. game:GetService('UserInputService').InputBegan:connect(function(InputObj)
  107. if InputObj.KeyCode == Enum.KeyCode.Slash then
  108. local finishEvent = nil
  109. isTyping = true
  110. finishEvent = game:GetService('UserInputService').InputBegan:connect(function(InputObj)
  111. if InputObj.KeyCode == Enum.KeyCode.Return or InputObj.UserInputType == Enum.UserInputType.MouseButton1 then
  112. isTyping = false
  113. finishEvent:disconnect()
  114. end
  115. end)
  116. end
  117. end)
  118.  
  119. Ded = false
  120. Deboun = false
  121. for i,v in pairs(c:children()) do
  122. if v.ClassName == "Part" then
  123. v.Touched:connect(function(Hit)
  124. if Hit.Parent ~= c and Hit.Name ~= "touchy" then
  125. if v.Velocity.Y >= 150 or v.Velocity.Y <= -150 or v.Velocity.Z >= 150 or v.Velocity.Z <= -150 or v.Velocity.X >= 150 or v.Velocity.X <= -150 then
  126. if v.Velocity.Y >= 50 or v.Velocity.Y <= -50 then
  127. if Hit.Parent:findFirstChild("Humanoid")== nil then
  128. local S = Instance.new("Sound",c.HumanoidRootPart)S.SoundId = "rbxassetid://779129548" S.Volume = 3 S.PlaybackSpeed = 1 S:Play()
  129. v.Velocity = Vector3.new(10,10,10)
  130. for i = 1,4 do
  131. local Sizez = math.random(30,60)/10
  132. local Partz = Instance.new("Part",game.Workspace) Partz.Parent = game.Workspace Partz.Material = Hit.Material Partz.BrickColor = Hit.BrickColor Partz.Size = Vector3.new(Sizez,Sizez,Sizez)
  133. Partz.CanCollide = false Partz.Anchored = false Partz.CFrame = CFrame.new(v.Position)*CFrame.Angles(math.random(-90,90),math.random(-90,90),math.random(-90,90))
  134. local BV = Instance.new("BodyVelocity",Partz)BV.maxForce = Vector3.new(math.huge,math.huge,math.huge) Partz.Name = "touchy"
  135. BV.velocity = Vector3.new(math.random(-90,90),5,math.random(-90,90))game.Debris:AddItem(BV,0.1)
  136. end
  137. Ded = true wait(4) Ded = false
  138. end
  139. else
  140. if Hit.Parent:findFirstChild("Humanoid")== nil and Deboun == false then Deboun = true
  141. local Sizez = math.random(30,60)/10 Rubble.Volume = 3
  142. local Partz = Instance.new("Part",game.Workspace) Partz.Parent = game.Workspace Partz.Material = Hit.Material Partz.BrickColor = Hit.BrickColor Partz.Size = Vector3.new(Sizez,Sizez,Sizez)
  143. Partz.CanCollide = false Partz.Anchored = true Partz.CFrame = CFrame.new(v.Position)*CFrame.Angles(math.random(-90,90),math.random(-90,90),math.random(-90,90))game.Debris:AddItem(Partz,5)
  144. swait() Deboun = false
  145. end
  146. end
  147. elseif v.Velocity.Y >= 75 or v.Velocity.Y <= -75 or v.Velocity.Z >= 75 or v.Velocity.Z <= -75 or v.Velocity.X >= 75 or v.Velocity.X <= -75 then
  148. local S = Instance.new("Sound",c.HumanoidRootPart)S.SoundId = "rbxassetid://179760759" S.Volume = 10 S.PlaybackSpeed = math.random(6,8)/10 S:Play()
  149. v.Velocity = Vector3.new(1,1,1)
  150. Ded = true wait(2) Ded = false
  151. end
  152. Rubble.Volume = 0
  153. end
  154. end)
  155.  
  156. end
  157. end
  158. function makegloo(paren, co, ci, parto, parti, nam) local gloo = Instance.new("Glue") gloo.Name = nam gloo.C0 = co gloo.C1 = ci gloo.Part0 = parto gloo.Part1 = parti gloo.Parent = paren end
  159. function maketouchy(parent, limb, cframe) local pr = Instance.new("Part") pr.Name = "touchy" pr.Size = Vector3.new(1, 1, 1) pr.Transparency = 1 pr.CustomPhysicalProperties = PhysicalProperties.new(0.55, 0.3, 0.5) pr.CanCollide = true pr.Anchored = false pr.Parent = parent local w = Instance.new("Weld") w.Part0 = pr w.Part1 = limb w.C0 = cframe w.Parent = pr end
  160. function makejoint(paren, co, ci, parto, parti, nam)local gloo = Instance.new("Motor6D")gloo.Name = nam gloo.C0 = co gloo.C1 = ci gloo.Part0 = parto gloo.Part1 = parti gloo.Parent = paren end
  161. function RagBlast(cactus)
  162. cactus.Humanoid.PlatformStand = true Shot = true
  163. local BV = Instance.new("BodyVelocity",c.HumanoidRootPart)BV.Velocity = RightGun.CFrame.lookVector*-400 BV.maxForce = Vector3.new(math.huge,math.huge,math.huge)
  164. wait() BV:remove()
  165. if cactus["RightArm"]~=nil and cactus.Torso:FindFirstChild("Right Shoulder") then
  166. cactus.Torso:FindFirstChild("Right Shoulder"):Destroy()
  167. makegloo(cactus.Torso, RSC0, RSC1, cactus.Torso, cactus["RightArm"], "Right Shoulder")
  168. maketouchy(cactus["RightArm"], cactus["RightArm"], CFrame.new(0, 0.5, 0))
  169. end
  170. if cactus["Left Arm"]~=nil and cactus.Torso:FindFirstChild("Left Shoulder") then
  171. cactus.Torso:FindFirstChild("Left Shoulder"):Destroy()
  172. makegloo(cactus.Torso, LSC0, LSC1, cactus.Torso, cactus["Left Arm"], "Left Shoulder")
  173. maketouchy(cactus["Left Arm"], cactus["Left Arm"], CFrame.new(0, 0.5, 0))
  174. end
  175. if cactus["Right Leg"]~=nil and cactus.Torso:FindFirstChild("Right Hip") then
  176. cactus.Torso:FindFirstChild("Right Hip"):Destroy()
  177. makegloo(cactus.Torso, RHC0, RHC1, cactus.Torso, cactus["Right Leg"], "Right Hip")
  178. maketouchy(cactus["Right Leg"], cactus["Right Leg"], CFrame.new(0, 0.5, 0))
  179. end
  180. if cactus["Left Leg"]~=nil and cactus.Torso:FindFirstChild("Left Hip") then
  181. cactus.Torso:FindFirstChild("Left Hip"):Destroy()
  182. makegloo(cactus.Torso, LHC0, LHC1, cactus.Torso, cactus["Left Leg"], "Left Hip")
  183. maketouchy(cactus["Left Leg"], cactus["Left Leg"], CFrame.new(0, 0.5, 0))
  184. end
  185. local rag = true
  186. while rag == true do
  187. c.Humanoid.PlatformStand = true if Shot == false then break end
  188. if c.HumanoidRootPart.Velocity.Y < 0.5 and c.HumanoidRootPart.Velocity.Y > -0.5
  189. and c.HumanoidRootPart.Velocity.X < 1 and c.HumanoidRootPart.Velocity.X > -1
  190. and c.HumanoidRootPart.Velocity.Z < 1 and c.HumanoidRootPart.Velocity.Z > -1
  191. and Ded == false then rag = false break end
  192. wait()
  193. end
  194. if c.Humanoid.PlatformStand == true then c.Humanoid.Jump = true c.Humanoid.PlatformStand = false end
  195. Shot = false
  196. if cactus["RightArm"] and cactus.Torso:FindFirstChild("Right Shoulder") then
  197. cactus.Torso:FindFirstChild("Right Shoulder"):Destroy()
  198. makejoint(cactus.Torso, RSC0, RSC1, cactus.Torso, cactus["RightArm"], "Right Shoulder")
  199. cactus["RightArm"]:FindFirstChild("touchy"):Destroy()
  200. end
  201. if cactus["Left Arm"] and cactus.Torso:FindFirstChild("Left Shoulder") then
  202. cactus.Torso:FindFirstChild("Left Shoulder"):Destroy()
  203. makejoint(cactus.Torso, LSC0, LSC1, cactus.Torso, cactus["Left Arm"], "Left Shoulder")
  204. cactus["Left Arm"]:FindFirstChild("touchy"):Destroy()
  205. end
  206. if cactus["Right Leg"] and cactus.Torso:FindFirstChild("Right Hip") then
  207. cactus.Torso:FindFirstChild("Right Hip"):Destroy()
  208. makejoint(cactus.Torso, RHC0, RHC1, cactus.Torso, cactus["Right Leg"], "Right Hip")
  209. cactus["Right Leg"]:FindFirstChild("touchy"):Destroy()
  210. end
  211. if cactus["Left Leg"] and cactus.Torso:FindFirstChild("Left Hip") then
  212. cactus.Torso:FindFirstChild("Left Hip"):Destroy()
  213. makejoint(cactus.Torso, LHC0, LHC1, cactus.Torso, cactus["Left Leg"], "Left Hip")
  214. cactus["Left Leg"]:FindFirstChild("touchy"):Destroy()
  215. end
  216. if cactus.Torso:findFirstChild("BodyPosition")~=nil then
  217. cactus.Torso.BodyPosition:remove()
  218. end
  219. if cactus.Torso:findFirstChild("BodyGyro")~=nil then
  220. cactus.Torso.BodyGyro:remove()
  221. end
  222. RS = cactus.Torso:FindFirstChild("Right Shoulder")
  223. LS = cactus.Torso:FindFirstChild("Left Shoulder")
  224. RH = cactus.Torso:FindFirstChild("Right Hip")
  225. LH = cactus.Torso:FindFirstChild("Left Hip")
  226. RJ = c.HumanoidRootPart:FindFirstChild("RootJoint")
  227. N = cactus.Torso:FindFirstChild("Neck")
  228. end
  229.  
  230. function GunBlast(Pos)
  231. spawn(function()
  232. local P = Instance.new("Part",c)P.Transparency = 0 P.CanCollide = false P.Anchored = true P.CFrame = Pos P.Size = Vector3.new(1,1,1)
  233. P.BrickColor = BrickColor.new("Medium stone grey")P.Material = "Neon" local PM = Instance.new("SpecialMesh",P)PM.MeshType = "Sphere"PM.Scale = Vector3.new(0,0,0)
  234. for i = 1,10 do
  235. PM.Scale = PM.Scale + Vector3.new(2,2,2)
  236. P.Transparency = P.Transparency + 0.1
  237. swait()
  238. end
  239. P:remove()
  240. end)
  241. end
  242.  
  243. mouse.Button1Down:connect(function()
  244. local P = Instance.new("Part",c)P.Transparency = 1 P.CanCollide = false P.Anchored = true P.CFrame = RightGun.CFrame*CFrame.new(0,0,1.5)
  245. local S = Instance.new("Sound",P)S.SoundId = "rbxassetid://158811113" S.Volume = 1 S:Play()
  246. GunBlast(RightGun.CFrame*CFrame.new(0,0,-1.5)) game.Debris:AddItem(P,2) RagBlast(c)
  247. end)
  248.  
  249. idletime = 0
  250. sine = 0
  251. game:GetService("RunService").RenderStepped:connect(function()
  252. c.Humanoid.Health = c.Humanoid.Health + 1
  253. if Shot == false then
  254. local ToMouse = (mouse.hit.p - Head.Position).unit
  255. local Angle = math.acos(ToMouse:Dot(Vector3.new(0, 1, 0)))
  256. local FromRightArmPos = (Head.Position + Head.CFrame:vectorToWorldSpace(Vector3.new(((Head.Size.X / 2) + (c["RightArm"].Size.X / 2)), ((Head.Size.Y / 2) - (c["RightArm"].Size.Z / 2)), 0)))
  257. local ToMouseRightArm = ((mouse.hit.p - FromRightArmPos) * Vector3.new(1 ,0, 1)).unit
  258. local Look = (Head.CFrame.lookVector * Vector3.new(1, 0, 1)).unit
  259. local LateralAngle = math.acos(ToMouseRightArm:Dot(Look))
  260. if tostring(LateralAngle) == "-1.#IND" then
  261. LateralAngle = 0
  262. end
  263. local Cross = Head.CFrame.lookVector:Cross(ToMouseRightArm)
  264. if LateralAngle > (math.pi / 2) then
  265. LateralAngle = (math.pi / 2)
  266. end
  267. if Cross.Y < 0 then
  268. LateralAngle = -LateralAngle
  269. end
  270. RS.C0 = CFrame.new(RS.C0.p) * CFrame.Angles(((math.pi / 2) - Angle), ((math.pi / 2) + LateralAngle), 0)
  271. RS.C0 = RS.C0*CFrame.Angles(0,0,math.rad(90))
  272. end
  273. end)
Add Comment
Please, Sign In to add comment