GeneralNW

{Roblox} U.G.F standard issue assault rifle

Sep 9th, 2016
295
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 42.09 KB | None | 0 0
  1.  
  2. Player = game:GetService("Players").LocalPlayer
  3. Character = Player.Character
  4. PlayerGui = Player.PlayerGui
  5. Backpack = Player.Backpack
  6. Torso = Character.Torso
  7. Head = Character.Head
  8. LeftArm = Character["Left Arm"]
  9. LeftLeg = Character["Left Leg"]
  10. RightArm = Character["Right Arm"]
  11. RightLeg = Character["Right Leg"]
  12. LS = Torso["Left Shoulder"]
  13. LH = Torso["Left Hip"]
  14. RS = Torso["Right Shoulder"]
  15. RH = Torso["Right Hip"]
  16. ModelName = "Weapon"
  17. attack = false
  18. attacktype = 1
  19. Hitdeb = 0
  20. Neck = Torso.Neck
  21. local neckcf0 = Neck.C0
  22. ----------------------------
  23. --Customize
  24. Ammo = 50
  25. --if (string.match(Player.Unlocks.Value,"RasAlgethi Ammo+") ~= nil) then
  26. MaxAmmo = 50
  27. --else
  28. --MaxAmmo = 10000000
  29. --end
  30. mindamage = 12
  31. maxdamage = 30
  32. crtmaxdamage = 39
  33. omindamage = mindamage
  34. omaxdamage = maxdamage
  35. ocrtmaxdamage = crtmaxdamage
  36. crtrate = 100/5
  37. --100%/critpercentage
  38. oblkbrkr = 0
  39. blockbreaker = oblkbrkr
  40. spread = 2
  41. spread = spread*100
  42. Ammoregen = 50
  43. --if (string.match(Player.Unlocks.Value,"RasAlgethi Range+") ~= nil) then
  44. range = 700
  45. --else
  46. --range = 15000
  47. --end
  48. rangepower = 50
  49. CurrentAmmo = "Normal"
  50. handlecolor = BrickColor.new("Really black")
  51. bcolor = BrickColor.new("Dark stone grey")
  52. gemcolor = BrickColor.new("Really black")
  53. ammotrail = BrickColor.new("Really black")
  54. ToolName = "U.G.F Standard Assault Rifle"
  55. ---------------------------------------------------------------------------------------------------------------------------------------
  56. if Character:findFirstChild("EquippedVal",true) ~= nil then
  57. Character:findFirstChild("EquippedVal",true).Parent = nil
  58. end
  59. ev = Instance.new("BoolValue",Character)
  60. ev.Name = "EquippedVal"
  61. ev.Value = false
  62. if Character:findFirstChild("Block",true) ~= nil then
  63. Character:findFirstChild("Block",true).Parent = nil
  64. end
  65. --player
  66. player = nil
  67. --welds
  68. RW, LW , RWL, LWL = Instance.new("Weld"), Instance.new("Weld"), Instance.new("Weld"), Instance.new("Weld")
  69. --what anim
  70. anim = "none"
  71. --other var
  72. player = Player
  73. ch = Character
  74. --save shoulders
  75. AoETrue = {}
  76. RSH, LSH , RHL, LHL = ch.Torso["Right Shoulder"], ch.Torso["Left Shoulder"] , ch.Torso["Right Hip"] , ch.Torso["Left Hip"]
  77. function RWFunc()
  78. RW.Part1 = ch["Right Arm"]
  79. RSH.Part1 = nil
  80. end
  81. function LWFunc()
  82. LW.Part1 = ch["Left Arm"]
  83. LSH.Part1 = nil
  84. end
  85. function RWLFunc()
  86. RWL.Part1 = ch["Right Leg"]
  87. RHL.Part1 = nil
  88. ch["Right Leg"].Name = "RightLeg"
  89. RightLeg.CanCollide = false
  90. end
  91. function LWLFunc()
  92. LWL.Part1 = ch["Left Leg"]
  93. LHL.Part1 = nil
  94. ch["Left Leg"].Name = "LeftLeg"
  95. LeftLeg.CanCollide = true
  96. end
  97. function RWLRem()
  98. RightLeg.Name = "Right Leg"
  99. RWL.Part1 = nil
  100. RHL.Part1 = ch["Right Leg"]
  101. RightLeg.CanCollide = false
  102. end
  103. function LWLRem()
  104. LeftLeg.Name = "Left Leg"
  105. LWL.Part1 = nil
  106. LHL.Part1 = ch["Left Leg"]
  107. LeftLeg.CanCollide = false
  108. end
  109. function RWRem()
  110. RW.Part1 = nil
  111. RSH.Part1 = ch["Right Arm"]
  112. end
  113. function LWRem()
  114. LW.Part1 = nil
  115. LSH.Part1 = ch["Left Arm"]
  116. end
  117. if Character:findFirstChild(ModelName,true) ~= nil then
  118. Character:findFirstChild(ModelName,true).Parent = nil
  119. RHL.Part1 = ch["Right Leg"]
  120. LHL.Part1 = ch["Left Leg"]
  121. RSH.Part1 = ch["Right Arm"]
  122. LSH.Part1 = ch["Left Arm"]
  123. end
  124. local swordholder = Instance.new("Model")
  125. swordholder.Name = ModelName
  126. swordholder.Parent = Character
  127. --derp
  128. RW.Part0 = ch.Torso
  129. RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0)
  130. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0)
  131. RW.Parent = swordholder
  132. --
  133. LW.Part0 = ch.Torso
  134. LW.C0 = CFrame.new(-1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.7, 0, 0.8)
  135. LW.C1 = CFrame.new(0, 0.5, 0)
  136. LW.Parent = swordholder
  137. --
  138. RWL.Part0 = ch.Torso
  139. RWL.C0 = CFrame.new(1, -1, 0) * CFrame.Angles(0, 0, 0)
  140. RWL.C1 = CFrame.new(0.5, 1, 0)
  141. RWL.Parent = swordholder
  142. --
  143. LWL.Part0 = ch.Torso
  144. LWL.C0 = CFrame.new(-1, -1, 0) * CFrame.Angles(0, 0, 0)
  145. LWL.C1 = CFrame.new(-0.5, 1, 0)
  146. LWL.Parent = swordholder
  147. local msh1 = Instance.new("BlockMesh")
  148. msh1.Scale = Vector3.new(1,1,1)
  149. local msh2 = Instance.new("BlockMesh")
  150. msh2.Scale = Vector3.new(1,1,1)
  151. local msh3 = Instance.new("BlockMesh")
  152. msh3.Scale = Vector3.new(1,1,1)
  153. local msh4 = Instance.new("BlockMesh")
  154. msh4.Scale = Vector3.new(1,1,1)
  155. local msh5 = Instance.new("BlockMesh")
  156. msh5.Scale = Vector3.new(1,1,1)
  157. local msh6 = Instance.new("BlockMesh")
  158. msh6.Scale = Vector3.new(1,1,1)
  159. local torsc = false
  160. for i,z in pairs(Character:GetChildren()) do
  161. if z.className == "CharacterMesh" then
  162. if z.BodyPart == Enum.BodyPart.Torso then
  163. torsc = true
  164. end
  165. end
  166. end
  167. if torsc then
  168. msh7 = Instance.new("SpecialMesh")
  169. msh7.MeshId = "http://www.roblox.com/asset/?id=3270017"
  170. msh7.Scale = Vector3.new(2.01,1,1.01)
  171. msh7.Scale = Vector3.new(2.01,1,1.01)
  172. else
  173. msh7 = Instance.new("BlockMesh")
  174. msh7.Scale = Vector3.new(2.01,0.1,1.01)
  175. end
  176. local msh8 = Instance.new("SpecialMesh")
  177. msh8.MeshId = "http://www.roblox.com/asset/?id=3270017"
  178. msh8.Scale = Vector3.new(0.5,0.5,7)
  179. msh8.Scale = Vector3.new(0.5,0.5,7)
  180. local msh9 = Instance.new("BlockMesh")
  181. msh9.Scale = Vector3.new(1,1,1)
  182. local prt1 = Instance.new("Part")
  183. prt1.formFactor = 3
  184. prt1.CanCollide = false
  185. prt1.Name = "Handle"
  186. prt1.Locked = true
  187. prt1.Size = Vector3.new(0.3,1,0.3)
  188. prt1.Parent = swordholder
  189. msh1.Parent = prt1
  190. prt1.BrickColor = handlecolor
  191. local prt2 = Instance.new("Part")
  192. prt2.formFactor = 3
  193. prt2.CanCollide = false
  194. prt2.Name = "Handle2"
  195. prt2.Locked = true
  196. prt2.Size = Vector3.new(0.5,0.2,1.5)
  197. prt2.Parent = swordholder
  198. msh2.Parent = prt2
  199. prt2.BrickColor = handlecolor
  200. local prt3 = Instance.new("Part")
  201. prt3.formFactor = 3
  202. prt3.CanCollide = false
  203. prt3.Name = "Handle3"
  204. prt3.Locked = true
  205. prt3.Size = Vector3.new(0.7,1.2,0.7)
  206. prt3.Parent = swordholder
  207. msh3.Parent = prt3
  208. prt3.BrickColor = bcolor
  209. local prt4 = Instance.new("Part")
  210. prt4.formFactor = 3
  211. prt4.CanCollide = false
  212. prt4.Name = "BackBarrel"
  213. prt4.Locked = true
  214. prt4.Size = Vector3.new(0.5,1.2,0.5)
  215. prt4.Parent = swordholder
  216. msh4.Parent = prt4
  217. prt4.BrickColor = handlecolor
  218. local prt5 = Instance.new("Part")
  219. prt5.formFactor = 3
  220. prt5.CanCollide = false
  221. prt5.Name = "Barrel"
  222. prt5.Locked = true
  223. prt5.Size = Vector3.new(0.4,2.5,0.4)
  224. prt5.Parent = swordholder
  225. msh5.Parent = prt5
  226. prt5.BrickColor = handlecolor
  227. local prt6 = Instance.new("Part")
  228. prt6.formFactor = 3
  229. prt6.CanCollide = false
  230. prt6.Name = "BarrelHandle"
  231. prt6.Locked = true
  232. prt6.Size = Vector3.new(0.3,1,0.3)
  233. prt6.Parent = swordholder
  234. msh6.Parent = prt6
  235. prt6.BrickColor = handlecolor
  236. local prt7 = Instance.new("Part")
  237. prt7.formFactor = 3
  238. prt7.CanCollide = false
  239. prt7.Name = "HolsterStrap"
  240. prt7.Locked = true
  241. prt7.Size = Vector3.new(1,1,1)
  242. prt7.Parent = swordholder
  243. msh7.Parent = prt7
  244. prt7.BrickColor = handlecolor
  245. local prt8 = Instance.new("Part")
  246. prt8.formFactor = 3
  247. prt8.CanCollide = false
  248. prt8.Name = "Holster"
  249. prt8.Locked = true
  250. prt8.Size = Vector3.new(1,1,1)
  251. prt8.Parent = swordholder
  252. msh8.Parent = prt8
  253. prt8.BrickColor = handlecolor
  254. local prt9 = Instance.new("Part")
  255. prt9.formFactor = 3
  256. prt9.CanCollide = false
  257. prt9.Name = "AmmoHolster"
  258. prt9.Locked = true
  259. prt9.Size = Vector3.new(0.2,1,0.7)
  260. prt9.Parent = swordholder
  261. msh9.Parent = prt9
  262. prt9.BrickColor = handlecolor
  263. local w1 = Instance.new("Weld")
  264. w1.Parent = prt1
  265. w1.Part0 = prt1
  266. local w2 = Instance.new("Weld")
  267. w2.Parent = prt2
  268. w2.Part0 = prt2
  269. w2.Part1 = prt1
  270. w2.C1 = CFrame.new(0, 0,0) * CFrame.Angles(0, 0, 0)
  271. w2.C0 = CFrame.Angles(math.rad(0), 0, 0) * CFrame.new(0, 0.6,0.5)
  272. local w3 = Instance.new("Weld")
  273. w3.Parent = prt3
  274. w3.Part0 = prt3
  275. w3.Part1 = prt2
  276. w3.C1 = CFrame.new(0, 0,0) * CFrame.Angles(0, 0, 0)
  277. w3.C0 = CFrame.Angles(math.rad(90+45), 0, 0) * CFrame.new(0, 0.25,-0.5)
  278. local w4 = Instance.new("Weld")
  279. w4.Parent = prt4
  280. w4.Part0 = prt4
  281. w4.Part1 = prt2
  282. w4.C1 = CFrame.new(0, 0,0) * CFrame.Angles(0, 0, 0)
  283. w4.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, 0.25,0.5)
  284. local w5 = Instance.new("Weld")
  285. w5.Parent = prt5
  286. w5.Part0 = prt5
  287. w5.Part1 = prt3
  288. w5.C1 = CFrame.new(0, 0,0) * CFrame.Angles(0, 0, 0)
  289. w5.C0 = CFrame.Angles(math.rad(0), 0, 0) * CFrame.new(0, 1.5,0)
  290. local w6 = Instance.new("Weld")
  291. w6.Parent = prt6
  292. w6.Part0 = prt6
  293. w6.Part1 = prt3
  294. w6.C1 = CFrame.new(0, 0,0) * CFrame.Angles(0, 0, 0)
  295. w6.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, 1.5,-0.5)
  296. local w7 = Instance.new("Weld")
  297. w7.Parent = prt7
  298. w7.Part0 = prt7
  299. w7.Part1 = Torso
  300. w7.C1 = CFrame.new(0, 0,0) * CFrame.Angles(0, 0, 0)
  301. if torsc then
  302. w7.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, 1,0)
  303. else
  304. w7.C0 = CFrame.Angles(0, 0, 0) * CFrame.new(0, 1,0)
  305. end
  306. local w8 = Instance.new("Weld")
  307. w8.Parent = prt8
  308. w8.Part0 = prt8
  309. w8.Part1 = Torso
  310. w8.C1 = CFrame.new(0, 0,0) * CFrame.Angles(0, 0, 0)
  311. w8.C0 = CFrame.Angles(math.rad(45), 0, 0) * CFrame.new(-1.1, 1-0.25,0)
  312. local w9 = Instance.new("Weld")
  313. w9.Parent = prt9
  314. w9.Part0 = prt9
  315. w9.Part1 = Torso
  316. w9.C1 = CFrame.new(0, 0,0) * CFrame.Angles(0, 0, 0)
  317. w9.C0 = CFrame.Angles(math.rad(45), 0, 0) * CFrame.new(1, 0.75,-0.5)
  318. local RAP = Instance.new("Part")
  319. RAP.formFactor = 0
  320. RAP.CanCollide = false
  321. RAP.Name = "RAPart"
  322. RAP.Locked = true
  323. RAP.Size = Vector3.new(1,1,1)
  324. RAP.Parent = swordholder
  325. RAP.Transparency = 1
  326. local w = Instance.new("Weld")
  327. w.Parent = RAP
  328. w.Part0 = RAP
  329. w.Part1 = RightArm
  330. w.C1 = CFrame.fromEulerAnglesXYZ(0, 0, 0) * CFrame.new(0, 0,0)
  331. w.C0 = CFrame.fromEulerAnglesXYZ(math.rad(0), 0, 0) * CFrame.new(0, 1, 0)
  332. function unequipweld()
  333. w1.Part1 = Torso
  334. w1.C1 = CFrame.fromEulerAnglesXYZ(0, math.rad(0), math.rad(0)) * CFrame.new(0, 0,0)
  335. w1.C0 = CFrame.fromEulerAnglesXYZ(math.rad(180),math.rad(-0), math.rad(0)) * CFrame.new(-1.15, 1, -0.6)
  336. end
  337. unequipweld()
  338. function equipweld()
  339. w1.Part0 = prt1
  340. w1.Part1 = RAP
  341. w1.C1 = CFrame.fromEulerAnglesXYZ(0, 0, 0) * CFrame.new(0, 0,0)
  342. w1.C0 = CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)) * CFrame.new(0, 0, 0)
  343. end
  344. function ss(parent,p) --Slash
  345. local SlashSound = Instance.new("Sound")
  346. SlashSound.SoundId = "rbxasset://sounds\\swordslash.wav"
  347. SlashSound.Parent = parent
  348. SlashSound.Volume = .7
  349. SlashSound.Pitch = p
  350. SlashSound.PlayOnRemove = true
  351. coroutine.resume(coroutine.create(function()
  352. wait()
  353. SlashSound.Parent = nil
  354. end))
  355. end
  356. function uss(parent,p) --unsheath
  357. local SlashSound = Instance.new("Sound")
  358. SlashSound.SoundId = "rbxasset://sounds\\unsheath.wav"
  359. SlashSound.Parent = parent
  360. SlashSound.Volume = .7
  361. SlashSound.Pitch = p
  362. SlashSound.PlayOnRemove = true
  363. coroutine.resume(coroutine.create(function()
  364. wait()
  365. SlashSound.Parent = nil
  366. end))
  367. end
  368. function cs(parent,p) --Magic Charge
  369. local SlashSound = Instance.new("Sound")
  370. SlashSound.SoundId = "http://www.roblox.com/asset/?id=2101137"
  371. SlashSound.Parent = parent
  372. SlashSound.Parent = parent
  373. SlashSound.Volume = .7
  374. SlashSound.Pitch = p
  375. SlashSound.PlayOnRemove = true
  376. coroutine.resume(coroutine.create(function()
  377. wait()
  378. SlashSound.Parent = nil
  379. end))
  380. end
  381. function ls(parent,p) --Lazer Sound
  382. local SlashSound = Instance.new("Sound")
  383. SlashSound.SoundId = "http://www.roblox.com/asset?id=1369158"
  384. SlashSound.Parent = parent
  385. SlashSound.Parent = parent
  386. SlashSound.Volume = .7
  387. SlashSound.Pitch = p
  388. SlashSound.PlayOnRemove = true
  389. coroutine.resume(coroutine.create(function()
  390. wait()
  391. SlashSound.Parent = nil
  392. end))
  393. end
  394. function ts(parent,p)
  395. local SlashSound = Instance.new("Sound")
  396. SlashSound.SoundId = "http://www.roblox.com/asset/?id=12222030"
  397. SlashSound.Parent = parent
  398. SlashSound.Parent = parent
  399. SlashSound.Volume = .7
  400. SlashSound.Pitch = p
  401. SlashSound.PlayOnRemove = true
  402. coroutine.resume(coroutine.create(function()
  403. wait()
  404. SlashSound.Parent = nil
  405. end))
  406. end
  407. function fs(parent,p) --Fire Sound
  408. local SlashSound = Instance.new("Sound")
  409. SlashSound.SoundId = "http://www.roblox.com/asset/?id=31758982"
  410. SlashSound.Parent = parent
  411. SlashSound.Parent = parent
  412. SlashSound.Volume = .7
  413. SlashSound.Pitch = p
  414. SlashSound.PlayOnRemove = true
  415. coroutine.resume(coroutine.create(function()
  416. wait()
  417. SlashSound.Parent = nil
  418. end))
  419. end
  420. function ms(parent,p) --Metal Cling Sound
  421. local SlashSound = Instance.new("Sound")
  422. SlashSound.SoundId = "rbxasset://sounds\\metal.ogg"
  423. SlashSound.Parent = parent
  424. SlashSound.Volume = 5
  425. SlashSound.Pitch = p
  426. SlashSound.PlayOnRemove = true
  427. coroutine.resume(coroutine.create(function()
  428. wait()
  429. SlashSound.Parent = nil
  430. end))
  431. end
  432. function bs(parent,p) --Berserk Sound
  433. local SlashSound = Instance.new("Sound")
  434. SlashSound.SoundId = "http://www.roblox.com/asset/?id=2676305"
  435. SlashSound.Parent = parent
  436. SlashSound.Parent = parent
  437. SlashSound.Volume = 1
  438. SlashSound.Pitch = p
  439. SlashSound.PlayOnRemove = true
  440. coroutine.resume(coroutine.create(function()
  441. wait()
  442. SlashSound.Parent = nil
  443. end))
  444. end
  445. function hs(parent,p) --Ammo Hit Sound
  446. ms(parent,p)
  447. end
  448. function as(parent,p) --Gun Shoot Sound
  449. local SlashSound = Instance.new("Sound")
  450. SlashSound.SoundId = "http://roblox.com/asset/?id=132456294"
  451. SlashSound.Parent = parent
  452. SlashSound.Volume = 0.5
  453. SlashSound.Pitch = p
  454. SlashSound.PlayOnRemove = true
  455. coroutine.resume(coroutine.create(function()
  456. wait()
  457. SlashSound.Parent = nil
  458. end))
  459. end
  460. function ars(parent,p) --Gun Reload Sound
  461. local SlashSound = Instance.new("Sound")
  462. SlashSound.SoundId = "http://roblox.com/asset/?id=138084889"
  463. SlashSound.Parent = parent
  464. SlashSound.Parent = parent
  465. SlashSound.Volume = 1
  466. SlashSound.Pitch = 1
  467. SlashSound.PlayOnRemove = true
  468. coroutine.resume(coroutine.create(function()
  469. wait()
  470. SlashSound.Parent = nil
  471. end))
  472. end
  473. --
  474. --
  475. function returndmg()
  476. mindamage = omindamage
  477. maxdamage = omaxdamage
  478. crtmaxdamage = ocrtmaxdamage
  479. end
  480. function subdmg(sub)
  481. mindamage = omindamage - sub
  482. maxdamage = omaxdamage - sub
  483. crtmaxdamage = ocrtmaxdamage - sub
  484. end
  485. function prcntdmg(sub)
  486. mindamage = math.floor(omindamage - (omindamage*(sub/100)))
  487. maxdamage = math.floor(omaxdamage - (omaxdamage*(sub/100)))
  488. crtmaxdamage = math.floor(ocrtmaxdamage - (ocrtmaxdamage*(sub/100)))
  489. end
  490. function tagHumanoid(humanoid, player)
  491. local creator_tag = Instance.new("ObjectValue")
  492. creator_tag.Value = player
  493. creator_tag.Name = "creator"
  494. creator_tag.Parent = humanoid
  495. end
  496. function untagHumanoid(humanoid)
  497. if humanoid ~= nil then
  498. local tag = humanoid:findFirstChild("creator")
  499. if tag ~= nil then
  500. tag.Parent = nil
  501. end
  502. end
  503. end
  504. local function rayCast(Pos, Dir, Max, Ignore) -- Origin Position , Direction, MaxDistance , IgnoreDescendants
  505. return game.Workspace:FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore)
  506. end
  507. function hideanim()
  508. attack = true
  509. ars(Head,0.85)
  510. for i = 0.25 ,1 ,0.25 do
  511. wait()
  512. RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
  513. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(25-15*i), 0, 0)
  514. LW.C0 = CFrame.new(-1.5, 0.5, -0.5) * CFrame.Angles(math.rad(40),math.rad(0),math.rad(25+10*i))
  515. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  516. w3.C0 = CFrame.Angles(math.rad(90+25*i), 0, 0) * CFrame.new(0, 0.25,-0.5)
  517. Neck.C0 = neckcf0 * CFrame.Angles(math.rad(-5*i),0,math.rad(0))
  518. end
  519. for i = 0.1 ,1 ,0.1 do
  520. wait()
  521. RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
  522. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(10-10*i), 0, 0)
  523. LW.C0 = CFrame.new(-1.5, 0.5, -0.5) * CFrame.Angles(math.rad(40),math.rad(0),math.rad(35+10*i))
  524. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  525. w3.C0 = CFrame.Angles(math.rad(115+20*i), 0, 0) * CFrame.new(0, 0.25,-0.5)
  526. Neck.C0 = neckcf0 * CFrame.Angles(math.rad(-5-5*i),0,math.rad(0))
  527. end
  528. for i = 0.1 ,1 ,0.1 do
  529. wait()
  530. RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(90-130*i),math.rad(0),math.rad(-60+60*i))
  531. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(0), 0, 0)
  532. LW.C0 = CFrame.new(-1.5, 0.5, -0.5+0.25*i) * CFrame.Angles(math.rad(40-20*i),math.rad(0),math.rad(45-22.5*i))
  533. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  534. w3.C0 = CFrame.Angles(math.rad(135), 0, 0) * CFrame.new(0, 0.25,-0.5)
  535. Neck.C0 = neckcf0 * CFrame.Angles(math.rad(-10+40*i),0,math.rad(-30*i))
  536. end
  537. unequipweld()
  538. for i = 0.1 ,1 ,0.1 do
  539. wait()
  540. RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(-20+20*i),math.rad(0),math.rad(0))
  541. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(0), 0, 0)
  542. LW.C0 = CFrame.new(-1.5, 0.5, -0.25+0.25*i) * CFrame.Angles(math.rad(20-20*i),math.rad(0),math.rad(22.5-22.5*i))
  543. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  544. w3.C0 = CFrame.Angles(math.rad(135), 0, 0) * CFrame.new(0, 0.25,-0.5)
  545. Neck.C0 = neckcf0 * CFrame.Angles(math.rad(30-30*i),0,math.rad(-30+30*i))
  546. end
  547. Neck.C0 = neckcf0
  548. RWRem()
  549. LWRem()
  550. attack = false
  551. end
  552. function equipanim()
  553. attack = true
  554. RWFunc()
  555. w3.C0 = CFrame.Angles(math.rad(135), 0, 0) * CFrame.new(0, 0.25,-0.5)
  556. for i = 0.1 ,1 ,0.1 do
  557. wait()
  558. RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(-20*i),math.rad(0),math.rad(0))
  559. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  560. LW.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0))
  561. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  562. Neck.C0 = neckcf0 * CFrame.Angles(math.rad(30*i),0,math.rad(-30*i))
  563. end
  564. equipweld()
  565. ars(Head,1)
  566. for i = 0.1 ,1 ,0.1 do
  567. wait()
  568. RW.C0 = CFrame.new(1.5, 0.5, -0.25*i) * CFrame.Angles(math.rad(-20+130*i),math.rad(0),math.rad(0))
  569. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  570. LW.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0))
  571. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  572. Neck.C0 = neckcf0 * CFrame.Angles(math.rad(30-35*i),0,math.rad(-30))
  573. end
  574. LWFunc()
  575. for i = 0.1 ,1 ,0.1 do
  576. wait()
  577. RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(110-20*i),math.rad(0),math.rad(-60*i))
  578. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(25*i), 0, 0)
  579. LW.C0 = CFrame.new(-1.5, 0.5, -0.5*i) * CFrame.Angles(math.rad(40*i),math.rad(0),math.rad(25*i))
  580. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  581. w3.C0 = CFrame.Angles(math.rad(135-45*i), 0, 0) * CFrame.new(0, 0.25,-0.5)
  582. Neck.C0 = neckcf0 * CFrame.Angles(math.rad(-5+5*i),0,math.rad(-30+30*i))
  583. end
  584. Neck.C0 = neckcf0
  585. attack = false
  586. end
  587. function faketors()
  588. local T = Instance.new("Part")
  589. T.formFactor = 0
  590. T.CanCollide = false
  591. T.Name = "FakeTorso"
  592. T.Locked = true
  593. T.Size = Torso.Size
  594. T.Parent = swordholder
  595. T.Transparency = 1
  596. T.BrickColor = Torso.BrickColor
  597. for i,z in pairs(Character:GetChildren()) do
  598. if z.className == "CharacterMesh" then
  599. if z.BodyPart == Enum.BodyPart.Torso then
  600. local SM = Instance.new("SpecialMesh",T)
  601. SM.MeshId = "http://www.roblox.com/asset/?id=" .. z.MeshId
  602. if z.BaseTextureId ~= 0 then
  603. SM.TextureId = z.BaseTextureId
  604. elseif z.OverlayTextureId ~= 0 then
  605. SM.TextureId = z.OverlayTextureId
  606. else
  607. SM.TextureId = ""
  608. end
  609. end
  610. end
  611. end
  612. local wt = Instance.new("Weld")
  613. wt.Parent = T
  614. wt.Part0 = T
  615. wt.Part1 = Torso
  616. RW.Part0 = T
  617. LW.Part0 = T
  618. T.Transparency = 0
  619. Torso.Transparency = 1
  620. RHL.Part0 = T
  621. LHL.Part0 = T
  622. return wt,T
  623. end
  624. if (script.Parent.className ~= "HopperBin") then
  625. Tool = Instance.new("HopperBin")
  626. Tool.Parent = Backpack
  627. Tool.Name = ToolName
  628. script.Parent = Tool
  629. end
  630. Bin = script.Parent
  631. function damagesplat(dmg,hit,crit,blocked)
  632. local mo = Instance.new("Model")
  633. mo.Name = dmg
  634. local pa = Instance.new("Part",mo)
  635. pa.formFactor = 3
  636. pa.Size = Vector3.new(0.8,0.3,0.8)
  637. if crit then
  638. pa.BrickColor = BrickColor.new("Bright yellow")
  639. elseif not crit then
  640. pa.BrickColor = BrickColor.new("Bright red")
  641. end
  642. if blocked then pa.BrickColor = BrickColor.new("Bright blue") end
  643. pa.CFrame = CFrame.new(hit.Position) * CFrame.new(0, 3, 0)
  644. pa.Name = "Head"
  645. local hah = Instance.new("Humanoid")
  646. hah.Parent = mo
  647. hah.MaxHealth = 0
  648. hah.Health = 0
  649. local bp = Instance.new("BodyPosition")
  650. bp.P = 14000
  651. bp.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  652. bp.position = hit.Position + Vector3.new(0, 5, 0)
  653. coroutine.resume(coroutine.create(function()
  654. wait()
  655. mo.Parent = workspace
  656. bp.Parent = pa
  657. wait(1.4)
  658. mo:remove()
  659. end))
  660. return pa
  661. end
  662. function damage(hum,dmg,critornot)
  663. local pa = damagesplat(dmg,hum.Torso,critornot)
  664. hum:TakeDamage(dmg)
  665. coroutine.resume(coroutine.create(function()
  666. tagHumanoid(hum,Player)
  667. wait(1)
  668. untagHumanoid(hum)
  669. end))
  670. return pa
  671. end
  672. function AddAmmo(add)
  673. Ammo = Ammo + add
  674. if Ammo > MaxAmmo then
  675. Ammo = MaxAmmo
  676. end
  677. end
  678. function ADmg(humm,hit,pos)
  679. if CurrentAmmo == "Normal" then
  680. if humm.Parent:findFirstChild("Block") ~= nil then
  681. if humm.Parent.Block.Value then
  682. damagesplat(0,humm.Torso,false,true)
  683. return
  684. end
  685. end
  686. prcntdmg(0)
  687. if critrandomizer ~= 1 then
  688. local rndmdamage = math.random(mindamage,maxdamage)
  689. damage(humm,rndmdamage,false)
  690. elseif critrandomizer == 1 then
  691. local rndmdamage = math.random(maxdamage,crtmaxdamage)
  692. damage(humm,rndmdamage,true)
  693. end
  694. elseif CurrentAmmo == "Poison" then
  695. if humm.Parent:findFirstChild("Block") ~= nil then
  696. if humm.Parent.Block.Value then
  697. damagesplat(0,humm.Torso,false,true)
  698. return
  699. end
  700. end
  701. prcntdmg(25)
  702. if critrandomizer ~= 1 then
  703. local rndmdamage = math.random(mindamage,maxdamage)
  704. damage(humm,rndmdamage,false)
  705. elseif critrandomizer == 1 then
  706. local rndmdamage = math.random(maxdamage,crtmaxdamage)
  707. damage(humm,rndmdamage,true)
  708. end
  709. if math.random(1,5) == 1 then
  710. local poisoncount = math.random(2,10)
  711. coroutine.resume(coroutine.create(function()
  712. repeat
  713. wait(1.5)
  714. poisoncount = poisoncount - 1
  715. local rndmdamage = math.floor(math.random(1,5)/2)
  716. local pa = damage(humm,rndmdamage,false)
  717. pa.BrickColor = BrickColor.new("Alder")
  718. until poisoncount <= 0
  719. end))
  720. end
  721. elseif CurrentAmmo == "Knockback" then
  722. if humm.Parent:findFirstChild("Block") ~= nil then
  723. if humm.Parent.Block.Value then
  724. damagesplat(0,humm.Torso,false,true)
  725. return
  726. end
  727. end
  728. prcntdmg(25)
  729. if critrandomizer ~= 1 then
  730. local rndmdamage = math.random(mindamage,maxdamage)
  731. damage(humm,rndmdamage,false)
  732. elseif critrandomizer == 1 then
  733. local rndmdamage = math.random(maxdamage,crtmaxdamage)
  734. damage(humm,rndmdamage,true)
  735. end
  736. local vel = Instance.new("BodyVelocity",humm.Torso)
  737. vel.maxForce = Vector3.new(1,1,1) * math.huge
  738. vel.P = vel.P * 5
  739. vel.velocity = Vector3.new(0,1,0) + CFrame.new(Torso.Position,humm.Torso.Position).lookVector * 10
  740. coroutine.resume(coroutine.create(function()
  741. wait() wait() wait() wait()
  742. vel.Parent=nil
  743. end))
  744. returndmg()
  745. end
  746. end
  747. function OT(hit) --Normal Damage
  748. if Hitdeb == 1 then return end
  749. if hit.Parent == nil then return end
  750. local hum = hit.Parent:findFirstChild("Humanoid") if hum ~= nil and hum ~= Character.Humanoid then
  751. if hum.Health <= 0 then return end
  752. if hit.Parent:findFirstChild("Block") ~= nil then
  753. if hit.Parent.Block.Value then
  754. damagesplat(0,hum.Torso,false,true)
  755. Hitdeb = 1
  756. if hit.Parent.Block:findFirstChild("BlockPower") ~= nil then
  757. if hit.Parent.Block.BlockPower.Value <= 1 then
  758. hit.Parent.Block.Value = false
  759. elseif hit.Parent.Block.BlockPower.Value > 1 then
  760. local critrandomizer = math.random(crtrate)
  761. if critrandomizer ~= 1 then
  762. hit.Parent.Block.BlockPower.Value = hit.Parent.Block.BlockPower.Value - blockbreaker
  763. elseif critrandomizer == 1 then
  764. hit.Parent.Block.BlockPower.Value = hit.Parent.Block.BlockPower.Value - blockbreaker + 2
  765. end
  766. end
  767. end
  768. return end end
  769. local critrandomizer = math.random(crtrate)
  770. if critrandomizer ~= 1 then
  771. local rndmdamage = math.random(mindamage,maxdamage)
  772. damage(hum,rndmdamage,false)
  773. elseif critrandomizer == 1 then
  774. local rndmdamage = math.random(maxdamage,crtmaxdamage)
  775. damage(hum,rndmdamage,true)
  776. end
  777. Hitdeb = 1
  778. end
  779. end
  780. function AoE(p,magnitude)
  781. local c = game.Workspace:GetChildren();
  782. for i = 1, #c do
  783. local hum = c[i]:findFirstChild("Humanoid")
  784. if hum ~= nil and hum.Health ~= 0 then
  785. local head = c[i]:findFirstChild("Head");
  786. if head ~= nil then
  787. local mag = (head.Position - p).magnitude;
  788. if mag <= magnitude and c[i].Name ~= Character.Name then
  789. local foundd = false
  790. for ii = 1 , #AoETrue do
  791. if AoETrue[ii] == c[i].Name then
  792. foundd = true
  793. end
  794. end
  795. if foundd then
  796. end
  797. --
  798. if not foundd then
  799. local critrandomizer = math.random(crtrate)
  800. if critrandomizer ~= 1 then
  801. local rndmdamage = math.random(mindamage,maxdamage)
  802. damage(hum,rndmdamage,false)
  803. elseif critrandomizer == 1 then
  804. local rndmdamage = math.random(maxdamage,crtmaxdamage)
  805. damage(hum,rndmdamage,true)
  806. end
  807. table.insert(AoETrue,c[i].Name)
  808. end
  809. end
  810. end
  811. end
  812. end
  813. for ii = 1 , #AoETrue do
  814. table.remove(AoETrue,#AoETrue)
  815. end
  816. end
  817. --
  818. --
  819. function effect(Color,Ref,LP,P1)
  820. local effectsmsh = Instance.new("BlockMesh")
  821. effectsmsh.Scale = Vector3.new(1,1,1)
  822. effectsmsh.Name = "Mesh"
  823. local effectsg = Instance.new("Part")
  824. effectsg.formFactor = 3
  825. effectsg.CanCollide = false
  826. effectsg.Name = "Eff"
  827. effectsg.Locked = true
  828. effectsg.Anchored = true
  829. effectsg.Size = Vector3.new(0.2,1,0.2)
  830. effectsg.Parent = swordholder
  831. effectsmsh.Parent = effectsg
  832. effectsg.BrickColor = BrickColor.new(Color)
  833. effectsg.Reflectance = Ref
  834. local point1 = P1
  835. local mg = (LP.p - point1.p).magnitude
  836. effectsg.Size = Vector3.new(0.2,mg,0.2)
  837. effectsg.CFrame = CFrame.new((LP.p+point1.p)/2,point1.p) * CFrame.Angles(math.rad(90),0,0)
  838. coroutine.resume(coroutine.create(function()
  839. for i = 0 , 1 , 0.1 do
  840. wait()
  841. effectsg.Transparency = 1*i
  842. effectsmsh.Scale = Vector3.new(1-1*i,1,1-1*i)
  843. end
  844. wait()
  845. effectsg.Parent = nil
  846. end))
  847. end
  848. --
  849. con = nil
  850. function dmgcnnct()
  851. if con ~= nil then
  852. con:disconnect()
  853. Hitdeb = 0
  854. end
  855. con = prt11.Touched:connect(OT)
  856. end
  857. function dmgdc()
  858. if con ~= nil then
  859. con:disconnect()
  860. Hitdeb = 0
  861. end
  862. end
  863. function rptddmg(value,des,inc)
  864. coroutine.resume(coroutine.create(function()
  865. repeat
  866. wait(inc)
  867. Hitdeb = 0
  868. until value == des
  869. end))
  870. end
  871. function atktype(s,e)
  872. coroutine.resume(coroutine.create(function ()
  873. attacktype = e
  874. wait(0.25)
  875. attacktype = s
  876. end))
  877. end
  878. function shoottrail(mouse)
  879. local p1 = (prt5.CFrame * CFrame.new(0,-prt5.Size.y/2,0)).p
  880. local spreadvector = (Vector3.new(math.random(-spread,spread),math.random(-spread,spread),math.random(-spread,spread)) / 100) * (p1-mouse.Hit.p).magnitude/100
  881. local dir = CFrame.new((p1+mouse.Hit.p)/2,mouse.Hit.p+spreadvector)
  882. local hit,pos = rayCast(p1,dir.lookVector,10,Character)
  883. local rangepos = range
  884. local function drawtrail(From,To)
  885. local effectsmsh = Instance.new("BlockMesh")
  886. effectsmsh.Scale = Vector3.new(1,1,1)
  887. effectsmsh.Name = "Mesh"
  888. local effectsg = Instance.new("Part")
  889. effectsg.formFactor = 3
  890. effectsg.CanCollide = false
  891. effectsg.Name = "Eff"
  892. effectsg.Locked = true
  893. effectsg.Anchored = true
  894. effectsg.Size = Vector3.new(0.2,0.2,0.2)
  895. effectsg.Parent = swordholder
  896. effectsmsh.Parent = effectsg
  897. effectsg.BrickColor = ammotrail
  898. effectsg.Reflectance = 0.25
  899. local LP = From
  900. local point1 = To
  901. local mg = (LP - point1).magnitude
  902. effectsmsh.Scale = Vector3.new(1,mg*5,1)
  903. effectsg.CFrame = CFrame.new((LP+point1)/2,point1) * CFrame.Angles(math.rad(90),0,0)
  904. coroutine.resume(coroutine.create(function()
  905. for i = 0 , 1 , 0.1 do
  906. wait()
  907. effectsg.Transparency = 1*i
  908. effectsmsh.Scale = Vector3.new(1-1*i,mg*5,1-1*i)
  909. end
  910. effectsg.Parent = nil
  911. end))
  912. end
  913. local newpos = p1
  914. local inc = rangepower
  915. repeat
  916. wait()
  917. rangepos = rangepos - 10
  918. dir = dir * CFrame.Angles(math.rad(-0.1),0,0)
  919. hit,pos = rayCast(newpos,dir.lookVector,inc,Character)
  920. drawtrail(newpos,pos)
  921. newpos = newpos + (dir.lookVector * inc)
  922. if inc >= 20 then
  923. inc = inc - 10
  924. end
  925. if hit ~= nil then
  926. rangepos = 0
  927. end
  928. until rangepos <= 0
  929. if hit ~= nil then
  930. hs(Head,1)
  931. if hit.Parent:FindFirstChild("Humanoid") ~= nil then
  932. hum = hit.Parent.Humanoid
  933. ADmg(hum,hit,pos)
  934. elseif hit.Parent.Parent ~= nil and hit.Parent.Parent:FindFirstChild("Humanoid") ~= nil then
  935. hum = hit.Parent.Parent.Humanoid
  936. ADmg(hum,hit,pos)
  937. end
  938. end
  939. end
  940. function Ready(mouse)
  941. if Ammo <= 0 then Reload() return end
  942. attack = true
  943. local wt,t = faketors()
  944. w7.Part1 = t
  945. w8.Part1 = t
  946. w9.Part1 = t
  947. Character.Humanoid.WalkSpeed = 5
  948. for i = 0.2 , 1 , 0.2 do
  949. wait()
  950. RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
  951. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(25-15*i), 0, 0)
  952. LW.C0 = CFrame.new(-1.5, 0.5, -0.5+0.25*i) * CFrame.Angles(math.rad(40+35*i),math.rad(0),math.rad(25))
  953. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  954. w3.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, 0.25,-0.5)
  955. w1.C0 = CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)) * CFrame.new(0, 0, 0)
  956. wt.C0 = CFrame.Angles(0, math.rad(50*i), 0)
  957. end
  958. for i = 0.2 , 1 , 0.2 do
  959. wait()
  960. RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
  961. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(10-10*i), 0, 0)
  962. LW.C0 = CFrame.new(-1.5, 0.5, -0.25+0.25*i) * CFrame.Angles(math.rad(75+20*i),math.rad(0),math.rad(25))
  963. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  964. w3.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, 0.25,-0.5)
  965. w1.C0 = CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)) * CFrame.new(0, 0, 0)
  966. wt.C0 = CFrame.Angles(0, math.rad(50+10*i), 0)
  967. end
  968. wait() wait()
  969. repeat
  970. wait()
  971. as(Head,1)
  972. coroutine.resume(coroutine.create(function()
  973. for z = 1 ,2 do
  974. coroutine.resume(coroutine.create(function()
  975. local meshb1 = Instance.new("BlockMesh")
  976. meshb1.Scale = Vector3.new(1,1,1)
  977. local shellb1 = Instance.new("Part")
  978. meshb1.Parent = shellb1
  979. shellb1.Anchored = true
  980. shellb1.formFactor = 3
  981. shellb1.Size = Vector3.new(0.3,0.3,0.3) * (math.random(100,300)/100)
  982. shellb1.CFrame = CFrame.new((prt5.CFrame * CFrame.new(0,-prt5.Size.y/2,0)).p) * CFrame.Angles(math.random(-100,100)/100,math.random(-100,100)/100,math.random(-100,100)/100)
  983. shellb1.Parent = swordholder
  984. shellb1.Transparency = 0
  985. if math.random(1,2) == 1 then
  986. shellb1.BrickColor = BrickColor.new("Bright red")
  987. else
  988. shellb1.BrickColor = BrickColor.new("Bright orange")
  989. end
  990. shellb1.CanCollide = false
  991. local incre = math.random(0,60)/100
  992. for i = 0 , 1 , 0.1 do
  993. wait()
  994. shellb1.CFrame = shellb1.CFrame + Torso.CFrame.lookVector*incre
  995. shellb1.Transparency = 1*i
  996. meshb1.Scale = Vector3.new(1+1*i,1+1*i,1+1*i)
  997. end
  998. shellb1.Parent=nil
  999. end))
  1000. end
  1001. shoottrail(mouse)
  1002. end))
  1003. Ammo = Ammo - 1
  1004. for i = 0.5 , 1 , 0.5 do
  1005. wait()
  1006. RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
  1007. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(-5*i), 0, 0)
  1008. LW.C0 = CFrame.new(-1.5, 0.5, -0) * CFrame.Angles(math.rad(95+5*i),math.rad(0),math.rad(25))
  1009. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  1010. w3.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, 0.25,-0.5)
  1011. w1.C0 = CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)) * CFrame.new(0, 0, 0)
  1012. wt.C0 = CFrame.Angles(0, math.rad(60), 0)
  1013. end
  1014. for i = 0.5 , 1 , 0.5 do
  1015. wait()
  1016. RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
  1017. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(-5+5*i), 0, 0)
  1018. LW.C0 = CFrame.new(-1.5, 0.5, -0) * CFrame.Angles(math.rad(100-5*i),math.rad(0),math.rad(25))
  1019. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  1020. w3.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, 0.25,-0.5)
  1021. w1.C0 = CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)) * CFrame.new(0, 0, 0)
  1022. wt.C0 = CFrame.Angles(0, math.rad(60), 0)
  1023. end
  1024. until not keyhold or Ammo <= 0
  1025. for i = 0.2 , 1 , 0.2 do
  1026. wait()
  1027. RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
  1028. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(15*i), 0, 0)
  1029. LW.C0 = CFrame.new(-1.5, 0.5, -0.25*i) * CFrame.Angles(math.rad(95-25*i),math.rad(0),math.rad(25))
  1030. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  1031. w3.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, 0.25,-0.5)
  1032. w1.C0 = CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)) * CFrame.new(0, 0, 0)
  1033. wt.C0 = CFrame.Angles(0, math.rad(60-60*i), 0)
  1034. end
  1035. w7.Part1 = Torso
  1036. w8.Part1 = Torso
  1037. w9.Part1 = Torso
  1038. RW.Part0 = Torso
  1039. LW.Part0 = Torso
  1040. Torso.Transparency = 0
  1041. RHL.Part0 = Torso
  1042. LHL.Part0 = Torso
  1043. t.Parent = nil
  1044. Character.Humanoid.WalkSpeed = 14
  1045. for i = 0.2 , 1 , 0.2 do
  1046. wait()
  1047. RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
  1048. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(15+10*i), 0, 0)
  1049. LW.C0 = CFrame.new(-1.5, 0.5, -0.25-0.25*i) * CFrame.Angles(math.rad(70-30*i),math.rad(0),math.rad(25))
  1050. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  1051. w3.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, 0.25,-0.5)
  1052. w1.C0 = CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)) * CFrame.new(0, 0, 0)
  1053. end
  1054. wait(0.25)
  1055. attack = false
  1056. end
  1057. function Reload()
  1058. attack = true
  1059. ars(Head,0.75)
  1060. for i = 0.1 , 1 , 0.1 do
  1061. wait()
  1062. RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60+20*i))
  1063. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(25-45*i), 0, 0)
  1064. LW.C0 = CFrame.new(-1.5, 0.5, -0.5+0.5*i) * CFrame.Angles(math.rad(40-60*i),math.rad(0),math.rad(25-15*i))
  1065. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  1066. w3.C0 = CFrame.Angles(math.rad(90+90*i), 0, 0) * CFrame.new(0, 0.25,-0.5)
  1067. Neck.C0 = neckcf0 * CFrame.Angles(math.rad(-10*i),0,math.rad(-20*i))
  1068. end
  1069. for i = 0.2 , 1 , 0.2 do
  1070. wait()
  1071. RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-40))
  1072. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(-20+20*i), 0, 0)
  1073. LW.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.Angles(math.rad(-20+40*i),math.rad(0),math.rad(10-10*i))
  1074. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  1075. w3.C0 = CFrame.Angles(math.rad(180), 0, 0) * CFrame.new(0, 0.25,-0.5)
  1076. Neck.C0 = neckcf0 * CFrame.Angles(math.rad(-10+20*i),0,math.rad(-20))
  1077. end
  1078. for i = 0.2 , 1 , 0.2 do
  1079. wait()
  1080. RW.C0 = CFrame.new(1.5-0.5*i, 0.5, -0.5*i) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-40-5*i))
  1081. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(45*i), 0, 0)
  1082. LW.C0 = CFrame.new(-1.5+0.5*i, 0.5, -0.5*i) * CFrame.Angles(math.rad(20+80*i),math.rad(0),math.rad(45*i))
  1083. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  1084. w3.C0 = CFrame.Angles(math.rad(180), 0, 0) * CFrame.new(0, 0.25,-0.5)
  1085. Neck.C0 = neckcf0 * CFrame.Angles(math.rad(10+10*i),0,math.rad(-20+10*i))
  1086. end
  1087. AddAmmo(Ammoregen)
  1088. for i = 0.2 , 1 , 0.2 do
  1089. wait()
  1090. RW.C0 = CFrame.new(1, 0.5, -0.5) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-45))
  1091. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(45+5*i), 0, 0)
  1092. LW.C0 = CFrame.new(-1, 0.5, -0.5) * CFrame.Angles(math.rad(100-10*i),math.rad(0),math.rad(45))
  1093. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  1094. w3.C0 = CFrame.Angles(math.rad(180), 0, 0) * CFrame.new(0, 0.25,-0.5)
  1095. Neck.C0 = neckcf0 * CFrame.Angles(math.rad(20+5*i),0,math.rad(-10+5*i))
  1096. end
  1097. for i = 0.1 , 1 , 0.1 do
  1098. wait()
  1099. RW.C0 = CFrame.new(1+0.5*i, 0.5, -0.5+0.5*i) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-45-15*i))
  1100. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(50-25*i), 0, 0)
  1101. LW.C0 = CFrame.new(-1-0.5*i, 0.5, -0.5) * CFrame.Angles(math.rad(90-60*i),math.rad(0),math.rad(45-20*i))
  1102. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  1103. w3.C0 = CFrame.Angles(math.rad(180-90*i), 0, 0) * CFrame.new(0, 0.25,-0.5)
  1104. Neck.C0 = neckcf0 * CFrame.Angles(math.rad(25-25*i),0,math.rad(-5+5*i))
  1105. end
  1106. Neck.C0 = neckcf0
  1107. attack = false
  1108. end
  1109. function AimedReady(mouse)
  1110. if Ammo <= 0 then Reload() return end
  1111. attack = true
  1112. local wt,t = faketors()
  1113. w7.Part1 = t
  1114. w8.Part1 = t
  1115. w9.Part1 = t
  1116. Character.Humanoid.WalkSpeed = 5
  1117. for i = 0.2 , 1 , 0.2 do
  1118. wait()
  1119. RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
  1120. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(25-15*i), 0, 0)
  1121. LW.C0 = CFrame.new(-1.5, 0.5, -0.5+0.25*i) * CFrame.Angles(math.rad(40+35*i),math.rad(0),math.rad(25))
  1122. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  1123. w3.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, 0.25,-0.5)
  1124. w1.C0 = CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)) * CFrame.new(0, 0, 0)
  1125. wt.C0 = CFrame.Angles(0, math.rad(50*i), 0)
  1126. Neck.C0 = neckcf0 * CFrame.Angles(0,math.rad(-20*i),0)
  1127. end
  1128. for i = 0.2 , 1 , 0.2 do
  1129. wait()
  1130. RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
  1131. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(10-10*i), 0, 0)
  1132. LW.C0 = CFrame.new(-1.5, 0.5, -0.25+0.25*i) * CFrame.Angles(math.rad(75+20*i),math.rad(0),math.rad(25))
  1133. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  1134. w3.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, 0.25,-0.5)
  1135. w1.C0 = CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)) * CFrame.new(0, 0, 0)
  1136. wt.C0 = CFrame.Angles(0, math.rad(50+10*i), 0)
  1137. end
  1138. wait() wait()
  1139. local orispread = spread
  1140. spread = 0
  1141. repeat
  1142. wait(0.15)
  1143. as(Head,1)
  1144. coroutine.resume(coroutine.create(function()
  1145. for z = 1 ,2 do
  1146. coroutine.resume(coroutine.create(function()
  1147. local meshb1 = Instance.new("BlockMesh")
  1148. meshb1.Scale = Vector3.new(1,1,1)
  1149. local shellb1 = Instance.new("Part")
  1150. meshb1.Parent = shellb1
  1151. shellb1.Anchored = true
  1152. shellb1.formFactor = 3
  1153. shellb1.Size = Vector3.new(0.3,0.3,0.3) * (math.random(100,300)/100)
  1154. shellb1.CFrame = CFrame.new((prt5.CFrame * CFrame.new(0,-prt5.Size.y/2,0)).p) * CFrame.Angles(math.random(-100,100)/100,math.random(-100,100)/100,math.random(-100,100)/100)
  1155. shellb1.Parent = swordholder
  1156. shellb1.Transparency = 0
  1157. if math.random(1,2) == 1 then
  1158. shellb1.BrickColor = BrickColor.new("Bright red")
  1159. else
  1160. shellb1.BrickColor = BrickColor.new("Bright orange")
  1161. end
  1162. shellb1.CanCollide = false
  1163. local incre = math.random(0,60)/100
  1164. for i = 0 , 1 , 0.1 do
  1165. wait()
  1166. shellb1.CFrame = shellb1.CFrame + Torso.CFrame.lookVector*incre
  1167. shellb1.Transparency = 1*i
  1168. meshb1.Scale = Vector3.new(1+1*i,1+1*i,1+1*i)
  1169. end
  1170. shellb1.Parent=nil
  1171. end))
  1172. end
  1173. shoottrail(mouse)
  1174. end))
  1175. Ammo = Ammo - 1
  1176. for i = 0.5 , 1 , 0.5 do
  1177. wait()
  1178. RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
  1179. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(-5*i), 0, 0)
  1180. LW.C0 = CFrame.new(-1.5, 0.5, -0) * CFrame.Angles(math.rad(95+5*i),math.rad(0),math.rad(25))
  1181. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  1182. w3.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, 0.25,-0.5)
  1183. w1.C0 = CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)) * CFrame.new(0, 0, 0)
  1184. wt.C0 = CFrame.Angles(0, math.rad(60), 0)
  1185. Neck.C0 = neckcf0 * CFrame.Angles(0,math.rad(-20+5*i),0)
  1186. end
  1187. for i = 0.5 , 1 , 0.5 do
  1188. wait()
  1189. RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
  1190. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(-5+5*i), 0, 0)
  1191. LW.C0 = CFrame.new(-1.5, 0.5, -0) * CFrame.Angles(math.rad(100-5*i),math.rad(0),math.rad(25))
  1192. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  1193. w3.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, 0.25,-0.5)
  1194. w1.C0 = CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)) * CFrame.new(0, 0, 0)
  1195. wt.C0 = CFrame.Angles(0, math.rad(60), 0)
  1196. Neck.C0 = neckcf0 * CFrame.Angles(0,math.rad(-15-5*i),0)
  1197. end
  1198. until not buttonhold or Ammo <= 0
  1199. spread = orispread
  1200. for i = 0.2 , 1 , 0.2 do
  1201. wait()
  1202. RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
  1203. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(15*i), 0, 0)
  1204. LW.C0 = CFrame.new(-1.5, 0.5, -0.25*i) * CFrame.Angles(math.rad(95-25*i),math.rad(0),math.rad(25))
  1205. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  1206. w3.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, 0.25,-0.5)
  1207. w1.C0 = CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)) * CFrame.new(0, 0, 0)
  1208. wt.C0 = CFrame.Angles(0, math.rad(60-60*i), 0)
  1209. Neck.C0 = neckcf0 * CFrame.Angles(0,math.rad(-20+20*i),0)
  1210. end
  1211. w7.Part1 = Torso
  1212. w8.Part1 = Torso
  1213. w9.Part1 = Torso
  1214. RW.Part0 = Torso
  1215. LW.Part0 = Torso
  1216. Torso.Transparency = 0
  1217. RHL.Part0 = Torso
  1218. LHL.Part0 = Torso
  1219. t.Parent = nil
  1220. Character.Humanoid.WalkSpeed = 14
  1221. for i = 0.2 , 1 , 0.2 do
  1222. wait()
  1223. RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
  1224. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(15+10*i), 0, 0)
  1225. LW.C0 = CFrame.new(-1.5, 0.5, -0.25-0.25*i) * CFrame.Angles(math.rad(70-30*i),math.rad(0),math.rad(25))
  1226. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  1227. w3.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, 0.25,-0.5)
  1228. w1.C0 = CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)) * CFrame.new(0, 0, 0)
  1229. end
  1230. wait(0.25)
  1231. attack = false
  1232. end
  1233. function returnwelds()
  1234. RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
  1235. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(25), 0, 0)
  1236. LW.C0 = CFrame.new(-1.5, 0.5, -0.5) * CFrame.Angles(math.rad(40),math.rad(0),math.rad(25))
  1237. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  1238. w3.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, 0.25,-0.5)
  1239. w1.C0 = CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)) * CFrame.new(0, 0, 0)
  1240. RWL.C0 = CFrame.new(1, -1, 0) * CFrame.Angles(0, 0, 0)
  1241. RWL.C1 = CFrame.new(0.5, 1, 0)
  1242. LWL.C0 = CFrame.new(-1, -1, 0) * CFrame.Angles(0, 0, 0)
  1243. LWL.C1 = CFrame.new(-0.5, 1, 0)
  1244. Neck.C0 = neckcf0
  1245. end
  1246. keyhold = false
  1247. function ob1d(mouse)
  1248. hold = true
  1249. if attack then return end
  1250. keyhold = true
  1251. Ready(mouse)
  1252. end
  1253. function ob1u(mouse)
  1254. keyhold = false
  1255. end
  1256. buttonhold = false
  1257. function key(key,mouse)
  1258. if attack then return end
  1259. if key == "r" then
  1260. Reload()
  1261. end
  1262. end
  1263. function s(mouse)
  1264. repeat wait() until not attack
  1265. repeat wait() until not ev.Value
  1266. mouse.Button1Down:connect(function() ob1d(mouse) end)
  1267. mouse.Button1Up:connect(function() ob1u(mouse) end)
  1268. mouse.KeyDown:connect(function(ke) key(ke,mouse) end)
  1269. mouse.KeyUp:connect(key2)
  1270. equipanim()
  1271. ev.Value = true
  1272. end
  1273. function ds(mouse)
  1274. keyhold = false
  1275. repeat wait() until not attack
  1276. repeat wait() until ev.Value
  1277. hideanim()
  1278. wait(0.1)
  1279. ev.Value = false
  1280. end
  1281. Bin.Selected:connect(s)
  1282. Bin.Deselected:connect(ds)
Add Comment
Please, Sign In to add comment