Advertisement
TheUnknownDiscord

pistol 2.0

Jun 27th, 2022
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.02 KB | None | 0 0
  1. local damage = 35
  2. local canshoot = true
  3. local tweenService = game:GetService("TweenService")
  4. Tool = Instance.new("Tool")
  5. Tool.Name = "Pistol 2.0"
  6. local magout = Instance.new("Sound")
  7. magout.SoundId = "rbxassetid://6829540723"
  8. magout.PlayOnRemove = true
  9. magout.Volume = 3
  10. magout.TimePosition = 0.2
  11. local magin = Instance.new("Sound")
  12. magin.SoundId = "rbxassetid://6829539267"
  13. magin.PlayOnRemove = true
  14. magin.Volume = 3
  15. magin.TimePosition = 0.2
  16. local slideback = Instance.new("Sound")
  17. slideback.SoundId = "rbxassetid://3617680419"
  18. slideback.PlayOnRemove = true
  19. slideback.Volume = 0.75
  20. local slidefront = Instance.new("Sound")
  21. slidefront.SoundId = "rbxassetid://3617684821"
  22. slidefront.PlayOnRemove = true
  23. slidefront.Volume = 0.75
  24. Gun = Instance.new("Part")
  25. local shoots = Instance.new("Sound",Gun)
  26. shoots.SoundId = "rbxassetid://4502821590"
  27. shoots.Volume = 1.5
  28. Gun2 = Instance.new("Part",Gun)
  29. Gun3 = Instance.new("Part",Gun)
  30. Gun.Name = "Handle"
  31. Gun.Parent = Tool
  32. Tool.Parent = owner.Character
  33. Gun.Size = Vector3.new(0.172, 0.805, 1.332)
  34. Gun.Massless = true
  35. Gun2.Size = Vector3.new(0.181, 0.25, 1.184)
  36. Gun2.Massless = true
  37. Gun2.CanCollide = false
  38. Gun3.Size = Vector3.new(0.141, 0.63, 0.319)
  39. Gun3.Massless = true
  40. Gun3.CanCollide = false
  41. Gun3.Transparency = 0
  42. weld = Instance.new("Weld",Gun)
  43. weld.Part0 = Gun2
  44. weld.Part1 = Gun
  45. weld.C0 = CFrame.new(0,-0.5,-0.025)
  46. weld2 = Instance.new("Weld",Gun)
  47. weld2.Part0 = Gun3
  48. weld2.Part1 = Gun
  49. weld2.C0 = CFrame.new(0,0.125,0.65)
  50. Mesh = Instance.new("SpecialMesh")
  51. Mesh.Parent = Gun
  52. Mesh2 = Instance.new("SpecialMesh")
  53. Mesh2.Parent = Gun2
  54. Mesh3 = Instance.new("SpecialMesh")
  55. Mesh3.Parent = Gun3
  56. local tweenService = game:GetService("TweenService")
  57. local timeToFade = 0.125
  58. local object = weld
  59. local tweenInfo = TweenInfo.new(timeToFade,Enum.EasingStyle.Quint,Enum.EasingDirection.Out)
  60. local tweenInfo2 = TweenInfo.new(0.25,Enum.EasingStyle.Quint,Enum.EasingDirection.Out)
  61. local goal = {}
  62. goal.C0 = CFrame.new(0,-0.5,0.2)
  63. local shot = tweenService:Create(object, tweenInfo, goal)
  64. local goal = {}
  65. goal.C0 = CFrame.new(0,-0.5,0.35)
  66. local shott = tweenService:Create(object, tweenInfo2, goal)
  67. local returnshot = {}
  68. returnshot.C0 = CFrame.new(0,-0.5,-0.025)
  69. local shot2 = tweenService:Create(object, tweenInfo, returnshot)
  70. Mesh.MeshId = "http://www.roblox.com/asset/?id=436643435"
  71. Mesh.TextureId = "http://www.roblox.com/asset/?id=436655930"
  72. Mesh.Scale = Vector3.new(0.01, 0.01, 0.01)
  73. Mesh2.MeshId = "http://www.roblox.com/asset/?id=436644181"
  74. Mesh2.TextureId = "http://www.roblox.com/asset/?id=436655930"
  75. Mesh2.Scale = Vector3.new(0.01, 0.01, 0.01)
  76. Mesh3.MeshId = "http://www.roblox.com/asset/?id=436643848"
  77. Mesh3.TextureId = "http://www.roblox.com/asset/?id=436655930"
  78. Mesh3.Scale = Vector3.new(0.01, 0.01, 0.01)
  79. local wels = Instance.new("Weld",owner.Character.Torso)
  80. wels.Part0 = owner.Character["Right Arm"]
  81. wels.Part1 = owner.Character.Torso
  82. wels.C0 = CFrame.new(0,0.5,0) * CFrame.Angles(math.rad(-90),0,0)
  83. wels.C1 = CFrame.new(1.5,0.5,0)
  84. wels.Enabled = false
  85. local wels2 = Instance.new("Weld",owner.Character.Torso)
  86. wels2.Part0 = owner.Character["Left Arm"]
  87. wels2.Part1 = owner.Character.Torso
  88. wels2.C0 = CFrame.new(0,0.5,0)
  89. wels2.C1 = CFrame.new(-1.5,0.5,0)
  90. wels2.Enabled = false
  91. count = 0
  92. function mag()
  93. local magdebris = Instance.new("Part",workspace)
  94. magdebris.Size = Vector3.new(0.121, 0.8, 0.26)
  95. magdebris.CFrame = Gun3.CFrame
  96. magdebris.Transparency = 1
  97. local magdebris2 = Instance.new("Part",workspace)
  98. magdebris2.Size = Vector3.new(0.141, 0.055, 0.319)
  99. magdebris2.CFrame = Gun3.CFrame
  100. local magweld = Instance.new("Weld",magdebris2)
  101. magweld.Part0 = magdebris
  102. magweld.Part1 = magdebris2
  103. magweld.C0 = CFrame.Angles(math.rad(-10),0,0) * CFrame.new(0,-0.5,0)
  104. game:GetService("Debris"):AddItem(magdebris,10)
  105. game:GetService("Debris"):AddItem(magdebris2,10)
  106. local Mesh4 = Instance.new("SpecialMesh")
  107. Mesh4.Parent = magdebris2
  108. Mesh4.MeshId = "http://www.roblox.com/asset/?id=436643848"
  109. Mesh4.TextureId = "http://www.roblox.com/asset/?id=436655930"
  110. Mesh4.Scale = Vector3.new(0.01, 0.01, 0.01)
  111. Mesh4.Offset = Vector3.new(0,0.5,0)
  112. magdebris:ApplyImpulse(magdebris.CFrame.upVector * (-10 * (magdebris:GetMass() + magdebris2:GetMass())))
  113. end
  114. Tool.Grip = CFrame.Angles(0,math.rad(180),0) * CFrame.new(0,-0.25,0.55)
  115. local reloading = false
  116. local blacklist = {}
  117. for i,v in pairs(owner:GetDescendants()) do
  118. table.insert(blacklist,v)
  119. end
  120. function animate(what)
  121. if what == "Reload" then
  122. reloading = true
  123. wels.Enabled = true
  124. wels2.Enabled = true
  125. if count == 0 then
  126. shot:Play()
  127. end
  128. local info = TweenInfo.new(0.175,Enum.EasingStyle.Sine,Enum.EasingDirection.Out)
  129. local g = {}
  130. g.C0 = CFrame.new(-0.2,0.5,0) * CFrame.Angles(math.rad(15),math.rad(5),math.rad(-15))
  131. g.C1 = CFrame.new(-1.5,0.25,0)
  132. local t = tweenService:Create(wels2, info, g)
  133. t:Play()
  134. local g = {}
  135. g.Grip = CFrame.Angles(0,math.rad(180),0) * CFrame.new(0,-0.25,0.55)
  136. local t = tweenService:Create(Tool, info, g)
  137. t:Play()
  138. local info = TweenInfo.new(0.175,Enum.EasingStyle.Sine,Enum.EasingDirection.Out)
  139. local g = {}
  140. g.C0 = CFrame.new(-0.1,0.5,0) * CFrame.Angles(math.rad(-90),math.rad(5),math.rad(-65))
  141. g.C1 = CFrame.new(1.5,0.25,0)
  142. local t = tweenService:Create(wels, info, g)
  143. t:Play()
  144. t.Completed:Wait()
  145. magout.Parent = Gun
  146. magout.Parent = nil
  147. mag()
  148. Gun3.Transparency = 1
  149. wels2.C0 = CFrame.new(0.5,2.25,0.35) * CFrame.Angles(math.rad(-75),math.rad(70),math.rad(15))
  150. wels2.C1 = CFrame.new(-1.65,0.25,0)
  151. wels.C0 = CFrame.new(0,0.75,0) * CFrame.Angles(math.rad(-85),math.rad(-5),math.rad(15))
  152. local fakemagcf = owner.Character["Left Arm"].CFrame:Inverse() * Gun3.CFrame
  153. local fakemag = Instance.new("Part",script)
  154. fakemag.Size = Vector3.new(0.141, 0.63, 0.319)
  155. fakemag.Massless = true
  156. fakemag.CanCollide = false
  157. local m = Instance.new("SpecialMesh",fakemag)
  158. m.MeshId = "http://www.roblox.com/asset/?id=436643848"
  159. m.TextureId = "http://www.roblox.com/asset/?id=436655930"
  160. m.Scale = Vector3.new(0.01, 0.01, 0.01)
  161. local w = Instance.new("Weld",owner.Character["Left Arm"])
  162. w.Part0 = fakemag
  163. w.Part1 = w.Parent
  164. w.C0 = fakemagcf * CFrame.Angles(math.rad(-60),math.rad(-75),math.rad(30))
  165. w.C1 = CFrame.new(1,-1,0)
  166. wels2.C0 = CFrame.new(-0.2,0.5,0) * CFrame.Angles(math.rad(15),math.rad(5),math.rad(-15))
  167. wels2.C1 = CFrame.new(-1.5,0.25,0)
  168. wels.C0 = CFrame.new(-0.1,0.5,0) * CFrame.Angles(math.rad(-90),math.rad(5),math.rad(-65))
  169. local info = TweenInfo.new(0.125,Enum.EasingStyle.Back,Enum.EasingDirection.Out)
  170. local g = {}
  171. g.C0 = CFrame.new(-0.1,0.5,0) * CFrame.Angles(math.rad(-85),math.rad(15),math.rad(-55))
  172. local t = tweenService:Create(wels, info, g)
  173. t:Play()
  174. t.Completed:Wait()
  175. local info = TweenInfo.new(0.2,Enum.EasingStyle.Quart,Enum.EasingDirection.Out)
  176. local g = {}
  177. g.C0 = CFrame.new(0.5,2.25,0.35) * CFrame.Angles(math.rad(-75),math.rad(70),math.rad(15))
  178. g.C1 = CFrame.new(-1.65,0.25,0)
  179. local t = tweenService:Create(wels2, info, g)
  180. t:Play()
  181. local info = TweenInfo.new(0.2,Enum.EasingStyle.Quart,Enum.EasingDirection.Out)
  182. local g = {}
  183. g.C0 = CFrame.new(0,0.75,0) * CFrame.Angles(math.rad(-85),math.rad(-5),math.rad(15))
  184. local t = tweenService:Create(wels, info, g)
  185. t:Play()
  186. t.Completed:Wait()
  187. local info = TweenInfo.new(0.175,Enum.EasingStyle.Quad,Enum.EasingDirection.In)
  188. local g = {}
  189. g.C0 = CFrame.new(0.5,2.25,0.5) * CFrame.Angles(math.rad(-95),math.rad(70),math.rad(15))
  190. g.C1 = CFrame.new(-1.65,0.25,0)
  191. local t = tweenService:Create(wels2, info, g)
  192. t:Play()
  193. local info = TweenInfo.new(0.175,Enum.EasingStyle.Quad,Enum.EasingDirection.In)
  194. local g = {}
  195. g.C0 = CFrame.new(0,0.75,0) * CFrame.Angles(math.rad(-95),math.rad(-5),math.rad(15))
  196. local t = tweenService:Create(wels, info, g)
  197. t:Play()
  198. magin.Parent = Gun
  199. magin.Parent = nil
  200. Gun3.Transparency = 0
  201. game:GetService("Debris"):AddItem(fakemag,0)
  202. t.Completed:Wait()
  203. if count == 0 then
  204. local info = TweenInfo.new(0.175,Enum.EasingStyle.Cubic,Enum.EasingDirection.In)
  205. local g = {}
  206. g.C0 = CFrame.new(0.5,2.25,0.75) * CFrame.Angles(math.rad(-100),math.rad(70),math.rad(15))
  207. g.C1 = CFrame.new(-1.5,0.25,0)
  208. local t = tweenService:Create(wels2, info, g)
  209. t:Play()
  210. local info = TweenInfo.new(0.25,Enum.EasingStyle.Cubic,Enum.EasingDirection.In)
  211. local g = {}
  212. g.C0 = CFrame.new(0,0.75,0) * CFrame.Angles(math.rad(-85),math.rad(-5),math.rad(-35))
  213. local t = tweenService:Create(wels, info, g)
  214. t:Play()
  215. t.Completed:Wait()
  216. local info = TweenInfo.new(0.175,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut)
  217. local g = {}
  218. g.C0 = CFrame.new(0.5,1.5,0.75) * CFrame.Angles(math.rad(-95),math.rad(75),math.rad(15))
  219. g.C1 = CFrame.new(-1.45,0.25,0)
  220. local t = tweenService:Create(wels2, info, g)
  221. t:Play()
  222. local info = TweenInfo.new(0.25,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut)
  223. local g = {}
  224. g.C0 = CFrame.new(0,0.75,0) * CFrame.Angles(math.rad(-90),math.rad(-10),math.rad(-35))
  225. local t = tweenService:Create(wels, info, g)
  226. t:Play()
  227. shott:Play()
  228. slideback.Parent = Gun
  229. slideback.Parent = nil
  230. t.Completed:Wait()
  231. shot2:Play()
  232. slidefront.Parent = Gun
  233. slidefront.Parent = nil
  234. end
  235. local info = TweenInfo.new(0.175,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut)
  236. local g = {}
  237. g.C0 = CFrame.new(0.5,2.25,0.45) * CFrame.Angles(math.rad(-95),math.rad(60),math.rad(15))
  238. g.C1 = CFrame.new(-1.85,0.25,0)
  239. local t = tweenService:Create(wels2, info, g)
  240. t:Play()
  241. local info = TweenInfo.new(0.25,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut)
  242. local g = {}
  243. g.C0 = CFrame.new(0,1,-0.2) * CFrame.Angles(math.rad(-92),math.rad(-15),0)
  244. g.C1 = CFrame.new(1.5,0.45,0)
  245. local t = tweenService:Create(wels, info, g)
  246. t:Play()
  247. local info = TweenInfo.new(0.25,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut)
  248. local g = {}
  249. g.Grip = CFrame.Angles(0,math.rad(190),0) * CFrame.new(0,-0.25,0.55)
  250. local t = tweenService:Create(Tool, info, g)
  251. t:Play()
  252. t.Completed:Wait()
  253. reloading = false
  254. count = 10
  255. elseif what == "Shoot" then
  256. canshoot = false
  257. shot:Play()
  258. local info = TweenInfo.new(0.0875,Enum.EasingStyle.Quint,Enum.EasingDirection.Out)
  259. local g = {}
  260. g.C0 = CFrame.new(0.5,2.25,-0.25) * CFrame.Angles(math.rad(-100),math.rad(60),math.rad(15))
  261. g.C1 = CFrame.new(-1.85,0.55,0.5)
  262. local t = tweenService:Create(wels2, info, g)
  263. t:Play()
  264. local info = TweenInfo.new(0.0875,Enum.EasingStyle.Quint,Enum.EasingDirection.Out)
  265. local g = {}
  266. g.C0 = CFrame.new(0,1,-0.4) * CFrame.Angles(math.rad(-97),math.rad(-15),0)
  267. g.C1 = CFrame.new(1.5,0.55,0.5)
  268. local t = tweenService:Create(wels, info, g)
  269. t:Play()
  270. t.Completed:Wait()
  271. if count ~= 0 then
  272. shot2:Play()
  273. end
  274. local info = TweenInfo.new(0.0875,Enum.EasingStyle.Quint,Enum.EasingDirection.In)
  275. local g = {}
  276. g.C0 = CFrame.new(0.5,2.25,0.45) * CFrame.Angles(math.rad(-95),math.rad(60),math.rad(15))
  277. g.C1 = CFrame.new(-1.85,0.25,0)
  278. local t = tweenService:Create(wels2, info, g)
  279. t:Play()
  280. local info = TweenInfo.new(0.0875,Enum.EasingStyle.Quint,Enum.EasingDirection.In)
  281. local g = {}
  282. g.C0 = CFrame.new(0,1,-0.2) * CFrame.Angles(math.rad(-92),math.rad(-15),0)
  283. g.C1 = CFrame.new(1.5,0.45,0)
  284. local t = tweenService:Create(wels, info, g)
  285. t:Play()
  286. t.Completed:Wait()
  287. canshoot = true
  288. end
  289. end
  290. local equipped = false
  291. e = Instance.new("RemoteEvent",owner.Character)
  292. e.OnServerEvent:Connect(function(_,what,pos)
  293. if equipped then
  294. if what == "reload" then
  295. if not reloading then
  296. animate("Reload")
  297. end
  298. elseif what == "shoot" then
  299. if count > 0 and not reloading and canshoot then
  300. count -= 1
  301. local shootybang
  302. shoots:Play()
  303. coroutine.wrap(function()
  304. local bullet = Instance.new("Part",script)
  305. bullet.Size = Vector3.new(0.25,0.25,10)
  306. bullet.CanCollide = false
  307. bullet.Anchored = true
  308. bullet.Color = Color3.fromRGB(235, 235, 12)
  309. bullet.Material = "Neon"
  310. local buls = Instance.new("Sound",bullet)
  311. buls.Volume = 5
  312. buls.Pitch = Random.new():NextNumber(1,1.25)
  313. local bulstab = {"3809085250","3809084884","3809085650","3809085996","3809086455"}
  314. buls.SoundId = "rbxassetid://"..bulstab[math.random(1,#bulstab)]
  315. buls.Looped = true
  316. buls.RollOffMinDistance = 50
  317. buls.RollOffMaxDistance = 125
  318. buls:Play()
  319. local a1 = Instance.new("Attachment",bullet)
  320. a1.CFrame = CFrame.new(0,-0.1,10)
  321. local a2 = Instance.new("Attachment",bullet)
  322. a2.CFrame = CFrame.new(0,0.1,10)
  323. local t = Instance.new("Trail",bullet)
  324. t.Attachment0 = a1
  325. t.Attachment1 = a2
  326. t.Color = ColorSequence.new(bullet.Color)
  327. t.WidthScale = NumberSequence.new{NumberSequenceKeypoint.new(0,1),NumberSequenceKeypoint.new(1,0)}
  328. t.Lifetime = 0.5
  329. t.MaxLength = 0
  330. t.MinLength = 0.1
  331. t.LightEmission = 1
  332. t.LightInfluence = 0.5
  333. t.TextureLength = 1
  334. t.TextureMode = "Stretch"
  335. t.FaceCamera = true
  336. Instance.new("SpecialMesh",bullet).MeshType = "Sphere"
  337. local ang = CFrame.Angles(0,0,math.pi * 2 * math.random()) * CFrame.Angles(math.random() * math.rad(0.5),0,0)
  338. bullet.CFrame = CFrame.new((Gun.CFrame * CFrame.new(0,0,2)).Position) * CFrame.Angles(CFrame.new((Gun.CFrame * CFrame.new(0,0,2)).Position,pos):ToEulerAnglesXYZ()) * ang
  339. local params = RaycastParams.new()
  340. params.FilterDescendantsInstances = {blacklist,bullet}
  341. params.FilterType = Enum.RaycastFilterType.Blacklist
  342. local sped = 20
  343. shootybang = game:GetService("RunService").Stepped:Connect(function(_,b)
  344. local res = workspace:Raycast(bullet.Position, bullet.CFrame.lookVector*((sped)*b*30), params)
  345. if not res then
  346. bullet.CFrame = bullet.CFrame * CFrame.new(0,0,(-sped)*b*30)
  347. sped = sped - (30*b)
  348. bullet.Size = Vector3.new(0.25,0.25,sped/2)
  349. a2.CFrame = CFrame.new(0,0.1,sped/2)
  350. a1.CFrame = CFrame.new(0,-0.1,sped/2)
  351. if sped < 0 then
  352. bullet:Destroy()
  353. shootybang:Disconnect()
  354. end
  355. else
  356. local whathit = res.Instance
  357. local hole2 = Instance.new("Part",workspace)
  358. table.insert(blacklist,hole2)
  359. hole2.Shape = "Cylinder"
  360. hole2.CanCollide = false
  361. hole2.Size = Vector3.new(0.02,0.35,0.35)
  362. hole2:BreakJoints()
  363. hole2.Position = res.Position
  364. local currentRightVector = whathit.CFrame.RightVector
  365. local upVector = res.Normal
  366. local newFacialVector = currentRightVector:Cross(upVector)
  367. hole2.CFrame = CFrame.fromMatrix(hole2.Position, currentRightVector, upVector, newFacialVector) * CFrame.Angles(0,0,math.rad(90))
  368. local holeweld = Instance.new("WeldConstraint",whathit)
  369. holeweld.Part0 = hole2
  370. holeweld.Part1 = whathit
  371. hole2.Color = Color3.fromRGB()
  372. game:GetService("Debris"):AddItem(hole2,30)
  373. hole2.Color = Color3.fromRGB()
  374. if res.Instance:FindFirstAncestorWhichIsA("Model") and res.Instance:FindFirstAncestorWhichIsA("Model"):FindFirstChild("Humanoid") then
  375. hole2.BrickColor = BrickColor.new("Maroon")
  376. end
  377. local params2 = RaycastParams.new()
  378. params2.FilterDescendantsInstances = {res.Instance}
  379. params2.FilterType = Enum.RaycastFilterType.Whitelist
  380. local res2 = workspace:Raycast(bullet.Position + bullet.CFrame.lookVector * 250,bullet.CFrame.lookVector * -500, params2)
  381. local depth = (res.Position - res2.Position).Magnitude
  382. if depth <= damage * 0.0525 then
  383. local perc = Instance.new("Sound")
  384. local randsound = {"6962155018","6962154328"}
  385. perc.SoundId = "rbxassetid://"..randsound[math.random(1,2)]
  386. perc.PlayOnRemove = true
  387. perc.Parent = bullet
  388. perc:Destroy()
  389. local whathit = res2.Instance
  390. local hole = Instance.new("Part",workspace)
  391. table.insert(blacklist,hole)
  392. hole.Shape = "Cylinder"
  393. hole.CanCollide = false
  394. hole.Size = Vector3.new(0.02,0.35,0.35)
  395. hole:BreakJoints()
  396. hole.Position = res2.Position
  397. local currentRightVector = whathit.CFrame.RightVector
  398. local upVector = res2.Normal
  399. local newFacialVector = currentRightVector:Cross(upVector)
  400. hole.CFrame = CFrame.fromMatrix(hole.Position, currentRightVector, upVector, newFacialVector) * CFrame.Angles(0,0,math.rad(90))
  401. local holeweld = Instance.new("WeldConstraint",whathit)
  402. holeweld.Part0 = hole
  403. holeweld.Part1 = whathit
  404. hole.Color = Color3.fromRGB()
  405. game:GetService("Debris"):AddItem(hole,30)
  406. hole.Color = Color3.fromRGB()
  407. if res2.Instance:FindFirstAncestorWhichIsA("Model") and res2.Instance:FindFirstAncestorWhichIsA("Model"):FindFirstChild("Humanoid") then
  408. hole.BrickColor = BrickColor.new("Maroon")
  409. end
  410. bullet.CFrame = CFrame.new(hole.Position) * CFrame.Angles(bullet.CFrame:ToEulerAnglesXYZ()) * CFrame.Angles(0,0,math.pi * 2 * math.random()) * CFrame.Angles(math.random() * math.rad(2),0,0)
  411. sped = sped - damage * 0.029
  412. bullet.Size = Vector3.new(0.25,0.25,sped/2)
  413. a2.CFrame = CFrame.new(0,0.1,sped/2)
  414. a1.CFrame = CFrame.new(0,-0.1,sped/2)
  415. if sped < 0 then
  416. bullet:Destroy()
  417. shootybang:Disconnect()
  418. end
  419. else
  420. local crac = Instance.new("Sound",bullet)
  421. local randsound = {"9063083721","9063080907"}
  422. crac.SoundId = "rbxassetid://"..randsound[math.random(1,2)]
  423. crac.PlayOnRemove = true
  424. crac.Volume = 1.5
  425. local perc = Instance.new("Sound",bullet)
  426. local randsound = {"6962155018","6962154328"}
  427. perc.SoundId = "rbxassetid://"..randsound[math.random(1,2)]
  428. perc.PlayOnRemove = true
  429. bullet:Destroy()
  430. shootybang:Disconnect()
  431. end
  432. local hum = res.Instance:FindFirstAncestorWhichIsA("Model") and res.Instance:FindFirstAncestorWhichIsA("Model"):FindFirstChild("Humanoid")
  433. if res.Instance.Name == "Head" then
  434. if hum then
  435. hum.Health = 0
  436. end
  437. else
  438. if hum then
  439. hum.Health = hum.Health - 35
  440. end
  441. end
  442. end
  443. end)
  444. end)()
  445. animate("Shoot")
  446. end
  447. elseif what == "camera" then
  448. --[[
  449. local lookvector = owner.Character.Torso.CFrame:toObjectSpace(pos).lookVector.unit
  450. rotwel.C0 = rotwel.C0:Lerp(CFrame.Angles(math.sin(-lookvector.Y)*1,0,0), 0.2)
  451. rotwel2.C0 = rotwel2.C0:Lerp(CFrame.new(0,-0.5,0) * CFrame.Angles(math.sin(-lookvector.Y)*1,0,0), 0.2)
  452. ]]--
  453. end
  454. end
  455. end)
  456. Tool.Unequipped:Connect(function()
  457. wels.Enabled = false
  458. wels2.Enabled = false
  459. wels2.C0 = CFrame.new(0,0.5,0)
  460. wels2.C1 = CFrame.new(-1.5,0.5,0)
  461. wels.C0 = CFrame.new(0,0.5,0)
  462. wels.C1 = CFrame.new(1.5,0.5,0)
  463. equipped = false
  464. end)
  465. Tool.Equipped:Connect(function()
  466. wels.Enabled = true
  467. wels2.Enabled = true
  468. local info = TweenInfo.new(0.25,Enum.EasingStyle.Back,Enum.EasingDirection.InOut)
  469. local g = {}
  470. g.C0 = CFrame.new(0.5,2.25,0.45) * CFrame.Angles(math.rad(-95),math.rad(60),math.rad(15))
  471. g.C1 = CFrame.new(-1.85,0.25,0)
  472. local t = tweenService:Create(wels2, info, g)
  473. t:Play()
  474. local info = TweenInfo.new(0.25,Enum.EasingStyle.Back,Enum.EasingDirection.InOut)
  475. local g = {}
  476. g.C0 = CFrame.new(0,1,-0.2) * CFrame.Angles(math.rad(-92),math.rad(-15),0)
  477. g.C1 = CFrame.new(1.5,0.45,0)
  478. local t = tweenService:Create(wels, info, g)
  479. t:Play()
  480. t.Completed:Wait()
  481. equipped = true
  482. end)
  483. NLS([[
  484. local auto = false
  485. local down = false
  486. e = script.Parent
  487. mouse = owner:GetMouse()
  488. mouse.KeyDown:Connect(function(key)
  489. key = key:lower()
  490. if key == "r" then
  491. e:FireServer("reload")
  492. end
  493. end)
  494. mouse.KeyDown:Connect(function(key)
  495. key = key:lower()
  496. if key == "=" then
  497. auto = not auto
  498. end
  499. end)
  500. mouse.Button1Down:Connect(function()
  501. down = true
  502. e:FireServer("shoot",mouse.Hit.Position)
  503. end)
  504. mouse.Button1Up:Connect(function()
  505. down = false
  506. end)
  507. while wait(0.0625) do
  508. if auto and down then
  509. e:FireServer("shoot",mouse.Hit.Position)
  510. end
  511. end
  512. ]],e)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement