Advertisement
simplistic27

Shotgun

Sep 1st, 2016
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 36.34 KB | None | 0 0
  1. Players = game:GetService("Players")
  2. Me = Players.LocalPlayer
  3. Char = Me.Character
  4. necko = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  5. Asset = "http://www.roblox.com/asset/?id="
  6. EffectModel = nil
  7. MeleeDmg = 10000
  8. Accuracy = {Minimum = 2, Maximum = 5.5, Momentum = 2}
  9. Selected = false
  10. ReloadFlash = false
  11. Attacking = false
  12. ReloadHold = false
  13. Reloading = false
  14. Swinging = false
  15. Aiming = false
  16. ReloadOn = false
  17. Debounce = true
  18. Hurt = false
  19. ModelName = "Weapon"
  20. ToolName = "Weapon"
  21. Icon = Asset..(58334502)
  22. function ReNew()
  23. if EffectModel then
  24. if EffectModel.Parent ~= workspace then
  25. pcall(function() EffectModel:remove() end)
  26. EffectModel = Instance.new("Model",workspace)
  27. EffectModel.Name = "Effects"
  28. end
  29. else
  30. EffectModel = Instance.new("Model",workspace)
  31. EffectModel.Name = "Effects"
  32. end
  33. end
  34. Ammunition = {
  35. MaxAmmo = 8,
  36. Ammo = 150000,
  37. Ammoleft = 999999999999999999999999,
  38. }
  39. Images = {
  40. Asset..(64291927),
  41. Asset..(64291941),
  42. Asset..(64291961),
  43. Asset..(64291977),
  44. }
  45. Sounds = {
  46. Fire = {Id = Asset..(2697294), Pitch = 0.92, Volume = 0.8},
  47. Reload = {Id = Asset..(2697295), Pitch = 1, Volume = 0.5},
  48. Slash = {Id = "rbxasset://sounds//swordslash.wav", Pitch = 1.2, Volume = 0.6},
  49. Out = {Id = "rbxasset://sounds\\clickfast.wav", Pitch = 1.4, Volume = 0.6},
  50. Hit = {Id = Asset..(10209590), Pitch = 1.1, Volume = 0.45},
  51. PartHit = {Id = "rbxasset://sounds\\metal.ogg", Pitch = 1, Volume = 0.2},
  52. }
  53. ContentProvider = game:GetService("ContentProvider")
  54. for _,v in pairs(Images) do ContentProvider:Preload(v) end
  55. V3 = Vector3.new
  56. C3 = Color3.new
  57. BN = BrickColor.new
  58. CN = CFrame.new
  59. CA = CFrame.Angles
  60. MR = math.rad
  61. MRA = math.random
  62. MP = math.pi
  63. MH = math.huge
  64. UD = UDim2.new
  65. function RC(Pos, Dir, Max, Ignore)
  66. return workspace:FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999)), Ignore)
  67. end
  68. function RayC(Start, En, MaxDist, Ignore)
  69. return RC(Start, (En - Start), MaxDist, Ignore)
  70. end
  71. function ComputePos(pos1, pos2)
  72. return CN(pos1, V3(pos2.x, pos1.y, pos2.z))
  73. end
  74. function DetectSurface(pos, part)
  75. local surface = nil
  76. local pospos = part.CFrame
  77. local pos2 = pospos:pointToObjectSpace(pos)
  78. local siz = part.Size
  79. local shaep = part.Shape
  80. if shaep == Enum.PartType.Ball or shaep == Enum.PartType.Cylinder then
  81. surface = {"Anything", CN(pospos.p, pos)*CN(0, 0, -(pospos.p - pos).magnitude+0.12)*CA(MR(-90), 0, 0)}
  82. else
  83. if pos2.Y > ((siz.Y/2)-0.01) then
  84. surface = {"Top", CA(0, 0, 0)}
  85. elseif pos2.Y < -((siz.Y/2)-0.01) then
  86. surface = {"Bottom", CA(-MP, 0, 0)}
  87. elseif pos2.X > ((siz.X/2)-0.01) then
  88. surface = {"Right", CA(0, 0, MR(-90))}
  89. elseif pos2.X < -((siz.X/2)-0.01) then
  90. surface = {"Left", CA(0, 0, MR(90))}
  91. elseif pos2.Z > ((siz.Z/2)-0.01) then
  92. surface = {"Back", CA(MR(90), 0, 0)}
  93. elseif pos2.Z < -((siz.Z/2)-0.01) then
  94. surface = {"Front", CA(MR(-90), 0, 0)}
  95. end
  96. end
  97. return surface
  98. end
  99. function Compute(pos1, pos2)
  100. local pos3 = Vector3.new(pos2.x, pos1.y, pos2.z)
  101. return CN(pos1, pos3)
  102. end
  103. function waitChild(n, p)
  104. local c = p:findFirstChild(n)
  105. if c then return c end
  106. while true do
  107. c = p.ChildAdded:wait()
  108. if c.Name == n then return c end
  109. end
  110. end
  111. function Notime(func)
  112. coroutine.resume(coroutine.create(function()
  113. func()
  114. end))
  115. end
  116. local C3 = Color3.new
  117. local UD = UDim2.new
  118. local V2 = Vector2.new
  119. Torso = waitChild("Torso", Char)
  120. Head = waitChild("Head", Char)
  121. Rarm = waitChild("Right Arm", Char)
  122. Larm = waitChild("Left Arm", Char)
  123. Rleg = waitChild("Right Leg", Char)
  124. Lleg = waitChild("Left Leg", Char)
  125. Neck = waitChild("Neck", Torso)
  126. Hum = waitChild("Humanoid", Char)
  127. RSH = waitChild("Right Shoulder", Torso)
  128. LSH = waitChild("Left Shoulder", Torso)
  129. RH = waitChild("Right Hip", Torso)
  130. LH = waitChild("Left Hip", Torso)
  131. RSH.Part0 = Torso
  132. LSH.Part0 = Torso
  133. RH.Part0 = Torso
  134. LH.Part0 = Torso
  135. local Classes = {"Frame", "ImageLabel", "ImageButton", "TextLabel", "TextButton", "TextBox"}
  136. function Make(Class, Par, Size, Pos, Color, Trans, Border, Borderc, Txt, TxtC, Img)
  137. local Mk = "Frame"
  138. for _,v in pairs(Classes) do
  139. if Class == v then
  140. Mk = v
  141. end
  142. end
  143. local g = Instance.new(Mk)
  144. g.Size = Size
  145. g.Position = Pos
  146. g.BackgroundColor3 = Color
  147. g.Transparency = Trans
  148. g.BorderSizePixel = Border
  149. g.BorderColor3 = Borderc
  150. if Mk == "TextButton" or Mk == "TextLabel" or Mk == "TextBox" then
  151. g.Text = Txt
  152. g.TextColor3 = TxtC
  153. elseif Mk == "ImageLabel" or Mk == "ImageButton" then
  154. g.Image = Img
  155. end
  156. g.Parent = Par
  157. return g
  158. end
  159. Gui = Me:findFirstChild("PlayerGui")
  160. if Gui then
  161. for _,v in pairs(Gui:children()) do if v.Name == "Weapon GUI" then v:remove() end end
  162. end
  163. Screen = Instance.new("ScreenGui")
  164. Screen.Name = "Weapon GUI"
  165. AmmoTable = {}
  166. AccuracyGuis = {}
  167. lul = {
  168. {unit = V2(0, -1), size = V2(2, 25), offset = V2(-1, -1-25)},
  169. {unit = V2(1, 0), size = V2(25, 2), offset = V2(1, -1)},
  170. {unit = V2(0, 1), size = V2(2, 25), offset = V2(-1, -1)},
  171. {unit = V2(-1, 0), size = V2(25, 2), offset = V2(-1-25, -1)}
  172. }
  173. Main = Make("Frame", Screen, UD(0, 175, 0, 20), UD(1, -185-60, 1, -30), C3(0.25, 0.25, 0.3), 0.6, 0, C3())
  174. for i = 1, Ammunition.MaxAmmo, 1 do
  175. local Fr = Make("Frame", Main, UD(0, 8, 0, 14), UD(1, -12*i, 0, -14-6), C3(0.25, 0.25, 0.3), 0.6, 0, C3())
  176. table.insert(AmmoTable, Fr)
  177. end
  178. AmmoAtm = Make("TextLabel", Main, UD(0, 0, 0, 0), UD(0, 8, 0.5, 0), C3(), 0, 0, C3(), "0", C3(1, 1, 1))
  179. AmmoAtm.BackgroundTransparency = 1
  180. AmmoAtm.TextXAlignment = "Left"
  181. AmmoAtm.Font = "ArialBold"
  182. AmmoAtm.FontSize = "Size18"
  183. AmmoLeft = Make("TextLabel", Main, UD(0, 0, 0, 0), UD(1, -8, 0.5, 0), C3(), 0, 0, C3(), "40", C3(1, 1, 1))
  184. AmmoLeft.BackgroundTransparency = 1
  185. AmmoLeft.TextXAlignment = "Right"
  186. AmmoLeft.Font = "ArialBold"
  187. AmmoLeft.FontSize = "Size18"
  188. ReloadGui = Make("TextLabel", Main, UD(0, 0, 0, 0), UD(1, -12, 0, -40), C3(), 1, 0, C3(), "RELOAD", C3(1, 0.25, 0.1))
  189. ReloadGui.TextXAlignment = "Right"
  190. ReloadGui.Font = "ArialBold"
  191. ReloadGui.FontSize = "Size24"
  192. for _, prop in pairs(lul) do
  193. local g = Make("Frame", Screen, UD(0, prop.size.x, 0, prop.size.y), UD(0.5, prop.offset.x, 0.5, prop.offset.y), C3(0.8, 0.8, 0.9), 1, 0, C3())
  194. table.insert(AccuracyGuis, {Gui = g, props = prop})
  195. end
  196. Screen.Parent = Gui
  197. local Offset = 0.1
  198. local Thing = 1
  199. local Speed1 = 0.1
  200. local Speed2 = 0
  201. local TempAcc = 0
  202. local AccTimesMax = 17
  203. local AccTime = 1.25
  204. local AccTimes = AccTimesMax
  205. local AccOn = false
  206. function AddInaccuracy(Acc)
  207. TempAcc = Acc
  208. end
  209. Notime(function()
  210. while true do
  211. ReNew()
  212. AmmoAtm.Text = Ammunition.Ammo
  213. AmmoLeft.Text = Ammunition.Ammoleft
  214. for i,v in pairs(AmmoTable) do
  215. v.Transparency = 1
  216. end
  217. for i = 1, Ammunition.Ammo do
  218. AmmoTable[i].Transparency = 0.6
  219. end
  220. if Ammunition.Ammo <= Ammunition.MaxAmmo/4 then ReloadFlash = true else ReloadFlash = false end
  221. local Speed = Torso.Velocity.magnitude
  222. Offset = 0
  223. if Speed > 1 then
  224. Speed1 = Speed
  225. Thing = Thing*1.2
  226. else
  227. Speed2 = Speed
  228. local lol = 1.4
  229. if AccOn then lol = AccTime end
  230. Thing = Thing/lol
  231. end
  232. if TempAcc ~= 0 then
  233. Speed1 = TempAcc
  234. Thing = TempAcc/2
  235. AccOn = true
  236. if TempAcc ~= 0 then
  237. AccTimes = AccTimes - 1
  238. if AccTimes < 1 then AccTimes = AccTimesMax Notime(function() wait(0.4) AccOn = false end) TempAcc = 0 end
  239. end
  240. end
  241. if Thing < 1 then Thing = 1 elseif Thing > 14 then Thing = 14 end
  242. Offset = Accuracy.Minimum + ((Speed1 - Speed1/Thing)/(Speed1 - Speed1/14))*Accuracy.Maximum
  243. Accuracy.Momentum = Offset
  244. wait()
  245. end
  246. end)
  247. Notime(function()
  248. while true do
  249. if ReloadFlash then
  250. if ReloadOn then
  251. ReloadOn = false
  252. ReloadGui.Transparency = 1
  253. else
  254. ReloadOn = true
  255. ReloadGui.Transparency = 0
  256. end
  257. else
  258. ReloadGui.Transparency = 1
  259. end
  260. wait(0.4)
  261. end
  262. end)
  263. Add = {
  264. Head = function(P, Scale)
  265. local m = Instance.new("SpecialMesh")
  266. m.MeshType = "Head"
  267. m.Scale = Scale or V3(1, 1, 1)
  268. m.Parent = P
  269. return m
  270. end,
  271. Sphere = function(P, Scale)
  272. local m = Instance.new("SpecialMesh")
  273. m.MeshType = "Sphere"
  274. m.Scale = Scale or V3(1, 1, 1)
  275. m.Parent = P
  276. return m
  277. end,
  278. Wedge = function(P, Scale)
  279. local m = Instance.new("SpecialMesh")
  280. m.MeshType = "Wedge"
  281. m.Scale = Scale or V3(1, 1, 1)
  282. m.Parent = P
  283. return m
  284. end,
  285. Block = function(P, Scale, Brick)
  286. local m = Instance.new("BlockMesh")
  287. m.Scale = Scale or V3(1,1,1)
  288. m.Parent = P
  289. return m
  290. end
  291. }
  292. for _,v in pairs(Sounds) do
  293. ContentProvider:Preload(v.Id)
  294. end
  295. function PlaySound(Sound, bool)
  296. Pitch = Sound.Pitch
  297. if bool then
  298. Pitch = MRA((Sound.Pitch*0.75)*1000, (Sound.Pitch*1.15)*1000)/1000
  299. end
  300. local a = Instance.new("Sound")
  301. a.SoundId = Sound.Id
  302. a.Volume = Sound.Volume
  303. a.Pitch = Pitch
  304. a.Name = "FX"
  305. a.Parent = Torso
  306. a:play()
  307. Notime(function()
  308. wait(1)
  309. a:remove()
  310. end)
  311. end
  312. function GetParts(pos, dist)
  313. local parts = {}
  314. local function o(p)
  315. for _,v in pairs(p:children()) do
  316. if v:IsA("BasePart") then
  317. if (pos - v.Position).magnitude <= dist then
  318. table.insert(parts, {v, (pos - v.Position).magnitude, v.Anchored})
  319. end
  320. end
  321. o(v)
  322. end
  323. end
  324. o(workspace)
  325. return parts
  326. end
  327. function GetHum(P)
  328. for _,v in pairs(P:children()) do
  329. if v:IsA("Humanoid") then
  330. if v.Health > 0 then
  331. return v
  332. end
  333. end
  334. end
  335. end
  336. function GetGroup(Pos, Distance, Hit)
  337. local tab = {}
  338. for _,v in pairs(workspace:children()) do
  339. local h = GetHum(v)
  340. local t = v:findFirstChild("Torso")
  341. if h and t and v ~= Hit.Parent then
  342. if (t.Position - Pos).magnitude <= Distance then
  343. table.insert(tab, {h, v, (t.Position - Pos).magnitude})
  344. end
  345. end
  346. end
  347. if Hit then
  348. local h = GetHum(Hit.Parent)
  349. if h then
  350. table.insert(tab, {h, Hit.Parent, 0})
  351. end
  352. end
  353. return tab
  354. end
  355. function Part(Par, Anc, Colli, Tran, Ref, Col, Siz)
  356. local p = Instance.new("Part")
  357. p.formFactor = "Custom"
  358. p.TopSurface = 0
  359. p.BottomSurface = 0
  360. p.Transparency = Tran
  361. p.Reflectance = Ref
  362. p.Anchored = Anc
  363. p.CanCollide = Colli
  364. p.BrickColor = Col
  365. p.Size = Siz
  366. p.Locked = true
  367. p.Parent = Par
  368. p:BreakJoints()
  369. return p
  370. end
  371. function Weld(P0, P1, C0, C1)
  372. local w = Instance.new("Weld")
  373. w.Part0 = P0
  374. w.Part1 = P1
  375. if C0 then
  376. w.C0 = C0
  377. end
  378. if C1 then
  379. w.C1 = C1
  380. end
  381. w.Parent = P0
  382. return w
  383. end
  384. for _,v in pairs(Char:children()) do
  385. if v.Name == ModelName then
  386. v:remove()
  387. end
  388. end
  389. for _,v in pairs(Char:children()) do if v.Name == ModelName then v:remove() end end
  390. Model = Instance.new("Model")
  391. Model.Name = ModelName
  392. FTorso = Part(Model, false, false, 1, 0, Torso.BrickColor, V3(2, 2, 1))
  393. FW = Weld(Torso, FTorso)
  394. RAB = Part(Model, false, false, 1, 0, BN("New Yeller"), V3(0.2, 0.2, 0.2))
  395. LAB = Part(Model, false, false, 1, 0, BN("New Yeller"), V3(0.2, 0.2, 0.2))
  396. RLB = Part(Model, false, false, 1, 0, BN("New Yeller"), V3(0.2, 0.2, 0.2))
  397. LLB = Part(Model, false, false, 1, 0, BN("New Yeller"), V3(0.2, 0.2, 0.2))
  398. RABW = Weld(Torso, RAB, CN(), CN(-1.5, -0.5, 0))
  399. LABW = Weld(Torso, LAB, CN(), CN(1.5, -0.5, 0))
  400. RLBW = Weld(Torso, RLB, CN(), CN(-0.5, 1, 0))
  401. LLBW = Weld(Torso, LLB, CN(), CN(0.5, 1, 0))
  402. RAW = Weld(RAB, nil, CN(), CN(0, 0.5, 0))
  403. LAW = Weld(LAB, nil, CN(), CN(0, 0.5, 0))
  404. RLW = Weld(RLB, nil, CN(), CN(0, 1, 0))
  405. LLW = Weld(LLB, nil, CN(), CN(0, 1, 0))
  406. TW = Weld(Torso, nil, CN(-0.4, -1.5, 0.7), CA(MR(55), MR(-90), MR(0)))
  407. local FH = Instance.new("Humanoid",Model)
  408. FH.PlatformStand = true
  409. FH.MaxHealth = math.huge
  410. FH.Health = math.huge
  411. pcall(function() Torso:findFirstChild("Shirt"):clone().Parent = Model end)
  412. local hh = Part(Model, false, false, 1, 0, BN("New Yeller"), V3(0.2, 0.2, 0.2))
  413. hh.Name = "Head"
  414. Weld(FTorso, hh)
  415. Weapon = Instance.new("Model")
  416. Weapon.Name = "Weapon"
  417. HB = Part(Weapon, false, false, 1, 0, BN("New Yeller"), V3(0.2, 0.2, 0.2))
  418. HBW = Weld(Rarm, HB, CN(0, -0.7, 0), CA(MR(-90), MR(180), 0))
  419. HW = Weld(HB, nil, CA(MR(38), MR(-28), MR(-90)) * CN(0, -0.2, -3.8))
  420. LHB = Part(Weapon, false, false, 1, 0, BN("New Yeller"), V3(0.2, 0.2, 0.2))
  421. LHBW = Weld(Larm, LHB, CN(0, -0.7, 0), CA(MR(-90), MR(180), 0))
  422. LHW = Weld(LHB, nil, CA(MR(-2), MR(30), MR(-3)) * CN(-0.1, 0.32, -0.24))
  423. LHWK = Weld(LHB, nil, CA(MR(170), 0, 0))
  424. Handle = Part(Weapon, false, false, 0, 0, BN("Really black"), V3(0.5, 0.9, 0.9))
  425. TW.Part1 = Handle
  426. Handle2 = Part(Weapon, false, false, 0, 0, BN("Really black"), V3(0.5, 0.6, 1.6))
  427. Weld(Handle, Handle2, CA(MR(-45), 0, 0), CN(0, 0.5, -0.4))
  428. Handle3 = Part(Weapon, false, false, 0, 0, BN("Really black"), V3(0.5, 0.7, 1.3))
  429. Weld(Handle2, Handle3, CA(MR(45), 0, 0), CN(0, -0.4, -0.9))
  430. Pipe1 = Part(Weapon, false, false, 0, 0.1, BN("Lime green"), V3(0.3, 0.3, 3.2))
  431. Add.Block(Pipe1, V3(1,1,1), 0.08)
  432. Weld(Handle3, Pipe1, CN(0, 0.15, 1.6+0.55))
  433. Pipe2 = Part(Weapon, false, false, 0, 0.1, BN("Lime green"), V3(0.3, 0.3, 1.7))
  434. Add.Block(Pipe2, V3(1,1,1), 0.08)
  435. Weld(Handle3, Pipe2, CN(0, -0.15, 0.85+0.55))
  436. Pipe3 = Part(Weapon, false, false, 0, 0.1, BN("Lime green"), V3(0.25, 0.25, 1.6))
  437. Add.Block(Pipe3, V3(1,1,1), 0.065)
  438. Weld(Pipe2, Pipe3, CN(0, 0, 0.8+0.7))
  439. Pump = Part(Weapon, false, false, 0, 0, BN("Really black"), V3(0.45, 0.45, 1.1))
  440. Add.Block(Pump, V3(1,1,1), 0.225/2)
  441. PumpWeld = Weld(Pipe2, Pump, CN(0, 0, 0.6), CN(0, 0, 0))
  442. Pump2 = Part(Weapon, false, false, 0, 0, BN("Really black"), V3(0.5, 0.5, 0.3))
  443. Add.Block(Pump, V3(1,1,1), 0.13)
  444. Weld(Pump, Pump2, CN(0, 0, -0.5))
  445. for degrees = -20, 200, 20 do
  446. local Derp = Part(Weapon, false, false, 0, 0, BN("Really black"), V3(0.2, 0.2, 0.2))
  447. Add.Block(Derp, V3(0.4,0.6,0.4), 0.02)
  448. Weld(Handle3, Derp, CN(0, -0.45, -0.32) * CA(MR(degrees), 0, 0), CN(0, 0, -0.2))
  449. end
  450. Derp = Part(Weapon, false, false, 0, 0, BN("Really black"), V3(0.2, 0.2, 0.3))
  451. Add.Block(Derp, V3(0.4,1,1), 0.02)
  452. Weld(Handle3, Derp, CN(0, 0, -0.32) * CA(MR(-20), 0, 0), CN(0, 0.45, -0.2))
  453. Trigger = Part(Weapon, false, false, 0, 0, BN("Really black"), V3(0.2, 0.3, 0.2))
  454. Add.Block(Trigger, V3(0.5, 0.9, 0.3), 0.02)
  455. TriggerWeld = Weld(Handle3, Trigger, CN(0, -0.45, -0.4) * CA(MR(2), 0, 0))
  456. Aim = Part(Weapon, false, false, 0, 0, BN("Really black"), V3(0.3, 0.2, 0.7))
  457. Add.Block(Aim, V3(1,0.7,1), 0.05)
  458. Weld(Pipe1, Aim, CN(0, 0.12, 1.1))
  459. Aim1 = Part(Weapon, false, false, 0, 0, BN("Really black"), V3(0.2, 0.2, 0.2))
  460. Add.Block(Aim1, V3(0.3, 0.7, 0.5))
  461. Weld(Aim, Aim1, CN(-.1, 0.1, -0.25))
  462. Aim2 = Part(Weapon, false, false, 0, 0, BN("Really black"), V3(0.2, 0.2, 0.2))
  463. Add.Block(Aim2, V3(0.3, 0.7, 0.5))
  464. Weld(Aim, Aim2, CN(.1, 0.1, -0.25))
  465. Aim3 = Part(Weapon, false, false, 0, 0, BN("Really black"), V3(0.2, 0.2, 0.2))
  466. Add.Block(Aim3, V3(0.3, 0.7, 0.5))
  467. Weld(Aim, Aim3, CN(0, 0.1, 0.25))
  468. BulletFlip = Part(Weapon, false, false, 0, 0, BN("Lime green"), V3(0.2, 0.3, 0.6))
  469. Flip = Weld(Handle3, BulletFlip, CN(-0.18, 0.1, 0.2) * CA(0, MR(-10), 0))
  470. ---POCKET
  471. BeltWelds = {}
  472. BeltK = nil
  473. for i = -0.5, 0.5, 1 do
  474. local Belt = Part(Weapon, false, false, 0, 0, BN("Really black"), V3(2.1, 0.3, 0.2))
  475. table.insert(BeltWelds, Weld(Torso, Belt, CN(0, -0.9, i)))
  476. end
  477. for i = 1, -1, -2 do
  478. local Belt = Part(Weapon, false, false, 0, 0, BN("Really black"), V3(0.2, 0.3, 1.1))
  479. table.insert(BeltWelds, Weld(Torso, Belt, CN(i, -0.9, 0)))
  480. BeltK = Belt
  481. end
  482. for i = -0.25, 0.25, 0.5 do
  483. local Pocket = Part(Weapon, false, false, 0, 0, BN("Really black"), V3(1.1, 0.9, 0.2))
  484. table.insert(BeltWelds, Weld(Torso, Pocket, CN(0.8, -1.2, -0.8) * CA(0, MR(-15), 0), CN(0, 0, i)))
  485. end
  486. for i = -0.5, 0.5, 1 do
  487. local Pocket = Part(Weapon, false, false, 0, 0, BN("Really black"), V3(0.6, 0.9, 0.2))
  488. table.insert(BeltWelds, Weld(Torso, Pocket, CN(0.8, -1.2, -0.8) * CA(0, MR(-15)+MP/2, 0), CN(0, 0, i)))
  489. end
  490. Pocket = Part(Weapon, false, false, 0, 0, BN("Really black"), V3(1.1, 0.2, 0.6))
  491. table.insert(BeltWelds, Weld(Torso, Pocket, CN(0.8, -1.6, -0.8) * CA(0, MR(-15), 0)))
  492. function Shell(P)
  493. local Shel = Instance.new("Model")
  494. local Back = Part(Shel, false, false, 0, 0, BN("Bright yellow"), V3(0.3, 0.3, 0.25))
  495. local Main = Part(Shel, false, false, 0, 0, BN("Bright red"), V3(0.3, 0.3, 0.4))
  496. Add.Block(Back, V3(1,1,1), 0.077)
  497. Add.Block(Main, V3(1,1,1), 0.077)
  498. Weld(Main, Back, CN(0, 0, -0.225))
  499. Shel.Parent = P
  500. return {Model = Shel, Back = Back, Main = Main}
  501. end
  502. for y = 0.15, 0.65, 0.25 do
  503. for x = -0.12, 0.13, 0.24 do
  504. for z = -0.25, 0.26, 0.5 do
  505. local sh = Shell(Weapon)
  506. Weld(Pocket, sh.Main, CN(z-0.05, y, x), CA(0, MP/2, 0))
  507. end
  508. end
  509. end
  510. KnifeSheath = Part(Weapon, false, false, 0, 0, BN("Really black"), V3(0.3, 0.9, 0.6))
  511. SheathWeld = Weld(BeltK, KnifeSheath, CN(-0.2, -0.3, -0.25) * CA(MR(-20), 0, 0))
  512. KnifeHandle = Part(Weapon, false, false, 0, 0, BN("Really black"), V3(0.3, 0.6, 0.3))
  513. KnifeWeld = Weld(KnifeSheath, KnifeHandle, CA(MP, 0, 0), CN(0, 0.9, 0))
  514. KnifeHandle2 = Part(Weapon, false, false, 0, 0, BN("Dark grey"), V3(0.3, 0.2, 0.4))
  515. Weld(KnifeHandle, KnifeHandle2, CN(0, 0.35, 0))
  516. KnifeBlade1 = Part(Weapon, false, false, 0, 0.1, BN("Lime green"), V3(0.2, 0.8, 0.3))
  517. Add.Block(KnifeBlade1, V3(0.4, 1, 1), 0.05)
  518. Weld(KnifeHandle2, KnifeBlade1, CN(0, 0.42, 0))
  519. KnifeBlade2 = Part(Weapon, false, false, 0, 0.1, BN("Lime green"), V3(0.2, 0.24, 0.24))
  520. Add.Block(KnifeBlade2, V3(0.4, 1, 1), 0.05)
  521. Weld(KnifeBlade1, KnifeBlade2, CN(0, 0.32, 0), CA(MR(45), 0, 0))
  522. function Show_Damage(P, D, Area)
  523. local mo = Instance.new("Model")
  524. mo.Name = D
  525. local p = Part(mo, true, false, 0, 0, BN("Bright red"), V3(0.2, 0.2, 0.2))
  526. p.Name = "Head"
  527. local m = Instance.new("SpecialMesh")
  528. m.MeshType = "Brick"
  529. m.Scale = Vector3.new(3.5, 2.3, 3.5)
  530. m.Parent = p
  531. local h = Instance.new("Humanoid")
  532. h.Health = 0
  533. h.MaxHealth = 0
  534. h.Name = "asd"
  535. h.Parent = mo
  536. local nah = true
  537. mo.Parent = workspace
  538. local cf = CN(P) * CN(MRA(-Area*100, Area*100)/100, MRA(-Area*100, Area*100)/100, MRA(-Area*100, Area*100)/100)
  539. p.CFrame = cf
  540. Notime(function()
  541. Notime(function()
  542. for i = 0, 6, 0.03 do
  543. wait()
  544. p.CFrame = cf * CN(0, i, 0)
  545. end
  546. end)
  547. wait(1.5)
  548. for i = 0, 1, 0.05 do
  549. p.Transparency = i
  550. if nah then mo.Name = "" nah = false else mo.Name = "- "..D nah = true end
  551. wait()
  552. end
  553. mo:remove()
  554. end)
  555. end
  556. function Hit(part)
  557. local H = GetHum(part.Parent)
  558. if H and Debounce and Hurt then
  559. Debounce = false
  560. local Dmg = MRA(MeleeDmg/1.3, MeleeDmg)
  561. H.Health = H.Health - Dmg
  562. Show_Damage(KnifeBlade2.Position, Dmg, 0.1)
  563. end
  564. end
  565. KnifeBlade1.Touched:connect(Hit)
  566. KnifeBlade2.Touched:connect(Hit)
  567. Weapon.Parent = Model
  568. Model.Parent = Char
  569. if script.Parent.className ~= "HopperBin" then
  570. h = Instance.new("HopperBin", Me.Backpack)
  571. h.Name = ToolName
  572. script.Parent = h
  573. end
  574. bin = script.Parent
  575. function Attach(t)
  576. RSH.Part0 = t
  577. LSH.Part0 = t
  578. RH.Part0 = t
  579. LH.Part0 = t
  580. RABW.Part0 = t
  581. LABW.Part0 = t
  582. LLBW.Part0 = t
  583. RLBW.Part0 = t
  584. for _,v in pairs(BeltWelds) do
  585. v.Part0 = t
  586. end
  587. if t == Torso then
  588. FTorso.Transparency = 1
  589. else
  590. Torso.Transparency = 1
  591. end
  592. t.Transparency = 0
  593. end
  594. function Normal()
  595. RAW.C0 = CA(MR(90), 0, MR(-65)) * CN(0.6, -0.9, 0)
  596. LAW.C0 = CA(MR(85), 0, MR(-40)) * CN(0.5, -0.5, 0)
  597. FW.C0 = CA(0, MR(-70), 0)
  598. HW.C0 = CA(MR(0), MR(5), MR(0)) * CN(0.4, 0, -1.2)
  599. LHW.C0 = CA(MR(-2), MR(30), MR(-3)) * CN(-0.1, 0.32, -0.24)
  600. PumpWeld.C1 = CN(0, 0, 0)
  601. Flip.C1 = CN(0, 0, 0)
  602. Attach(FTorso)
  603. LHW.Part1 = nil
  604. TW.Part1 = nil
  605. LHWK.Part1 = nil
  606. KnifeWeld.Part1 = KnifeHandle
  607. Neck.C0 = necko
  608. HW.Part1 = Handle
  609. end
  610. function Swing()
  611. Swinging = true
  612. for i = 0.5, 1, 0.5 do
  613. LAW.C0 = CA(MR(85-8*i), 0, MR(-40+5*i)) * CN(0.5, -0.5+0.2*i, 0)
  614. RAW.C0 = CA(MR(90-5*i), 0, MR(-65-5*i)) * CN(0.6+0.05*i, -0.9+0.05*i, -0.1*i)
  615. HW.C0 = CA(MR(-5*i), MR(5+5*i), MR(0)) * CN(0.4, 0, -1.2)
  616. FW.C0 = CA(0, MR(-70+8*i), 0)
  617. wait()
  618. end
  619. for i = 0.33, 1, 0.33 do
  620. LAW.C0 = CA(MR(77-37*i), 0, MR(-35+30*i)) * CN(0.5-0.15*i, -0.3+0.3*i, 0)
  621. RAW.C0 = CA(MR(85-15*i), 0, MR(-70-5*i)) * CN(0.65+0.15*i, -0.85+0.2*i, -0.1-0.2*i)
  622. HW.C0 = CA(MR(-5-15*i), MR(10+10*i), MR(0)) * CN(0.4, 0, -1.2)
  623. FW.C0 = CA(0, MR(-62+58*i), 0)
  624. wait()
  625. end
  626. LHWK.Part1 = KnifeHandle
  627. KnifeWeld.Part1 = nil
  628. PlaySound(Sounds.Slash)
  629. for i = 0.25, 1, 0.25 do
  630. LAW.C0 = CA(MR(40+30*i), 0, MR(-5-45*i)) * CN(0.35-0.2*i, -0.5*i, 0)
  631. RAW.C0 = CA(MR(70-15*i), 0, MR(-75-5*i)) * CN(0.8, -0.65+0.15*i, -0.3-0.05*i)
  632. HW.C0 = CA(MR(-20-10*i), MR(20+5*i), MR(0)) * CN(0.4, 0, -1.2)
  633. FW.C0 = CA(0, MR(-4+14*i), 0)
  634. LHWK.C0 = CN(0, -0.1*i, 0.2*i) * CA(MR(170), 0, MR(-50*i))
  635. wait()
  636. end
  637. Hurt = true
  638. Debounce = true
  639. for i = 0.25, 1, 0.25 do
  640. LAW.C0 = CA(MR(70+20*i), 0, MR(-50+35*i)) * CN(0.15-0.05*i, -0.5-0.3*i, 0)
  641. FW.C0 = CA(0, MR(10-60*i), 0)
  642. LHWK.C0 = CN(0, -0.1-0.05*i, 0.2+0.1*i) * CA(MR(170), 0, MR(-50-40*i))
  643. wait()
  644. end
  645. for i = 0.25, 1, 0.25 do
  646. LAW.C0 = CA(MR(90+10*i), 0, MR(-15+15*i)) * CN(0.1, -0.9, 0)
  647. FW.C0 = CA(0, MR(-50-40*i), 0)
  648. LHWK.C0 = CN(0, -0.15, 0.3) * CA(MR(170), 0, MR(-90))
  649. wait()
  650. end
  651. for i = 0.33, 1, 0.33 do
  652. LAW.C0 = CA(MR(100+3*i), 0, 0) * CN(0.1, -0.9, 0)
  653. FW.C0 = CA(0, MR(-90-6*i), 0)
  654. LHWK.C0 = CN(0, -0.15, 0.3) * CA(MR(170), 0, MR(-90))
  655. wait()
  656. end
  657. Hurt = false
  658. wait(0.04)
  659. for i = 0.25, 1, 0.25 do
  660. LAW.C0 = CA(MR(103-13*i), 0, 0) * CN(0.1, -0.9+0.1*i, 0)
  661. FW.C0 = CA(0, MR(-96+16*i), 0)
  662. LHWK.C0 = CN(0, -0.15, 0.3-0.1*i) * CA(MR(170), 0, MR(-90+15*i))
  663. wait()
  664. end
  665. for i = 0.25, 1, 0.25 do
  666. LAW.C0 = CA(MR(90-42*i), 0, 0) * CN(0.1+0.1*i, -0.8+0.3*i, 0)
  667. RAW.C0 = CA(MR(55+15*i), 0, MR(-80+5*i)) * CN(0.8-0.05*i, -0.5-0.1*i, -0.35+0.05*i)
  668. FW.C0 = CA(0, MR(-80+10*i), 0)
  669. HW.C0 = CA(MR(-30+20*i), MR(25-15*i), MR(0)) * CN(0.4, 0, -1.2)
  670. LHWK.C0 = CN(0, -0.15, 0.2-0.45*i) * CA(MR(170), 0, MR(-75+75*i))
  671. wait()
  672. end
  673. for i = 0.5, 1, 0.5 do
  674. LAW.C0 = CA(MR(48-8*i), 0, 0) * CN(0.2+0.05*i, -0.5, 0)
  675. RAW.C0 = CA(MR(70+10*i), 0, MR(-75+7*i)) * CN(0.75-0.05*i, -0.6-0.1*i, -0.3+0.05*i)
  676. FW.C0 = CA(0, MR(-70), 0)
  677. HW.C0 = CA(MR(-10+10*i), MR(10-5*i), MR(0)) * CN(0.4, 0, -1.2)
  678. LHWK.C0 = CN(0, -0.15, -0.25-0.15*i) * CA(MR(170), 0, 0)
  679. wait()
  680. end
  681. LHWK.Part1 = nil
  682. KnifeWeld.Part1 = KnifeHandle
  683. for i = 0.25, 1, 0.25 do
  684. LAW.C0 = CA(MR(40+40*i), 0, MR(-30*i)) * CN(0.25+0.2*i, -0.5, 0)
  685. RAW.C0 = CA(MR(80+10*i), 0, MR(-68+3*i)) * CN(0.7-0.1*i, -0.7-0.2*i, -0.25+0.2*i)
  686. wait()
  687. end
  688. for i = 0.5, 1, 0.5 do
  689. LAW.C0 = CA(MR(80+5*i), 0, MR(-30-10*i)) * CN(0.45+0.05*i, -0.5, -0.05+0.05*i)
  690. RAW.C0 = CA(MR(90), 0, MR(-65)) * CN(0.6, -0.9, 0)
  691. wait()
  692. end
  693. Normal()
  694. Swinging = false
  695. end
  696. function Reload(once)
  697. while Ammunition.Ammo < Ammunition.MaxAmmo and Ammunition.Ammoleft > 0 do
  698. wait()
  699. for i = 0.33, 1, 0.33 do
  700. RAW.C0 = CA(MR(45-2*i), 0, MR(-15)) * CN(0, -0.15-0.05*i, 0)
  701. LAW.C0 = CA(MR(50), MR(40), MR(-15)) * CN(0.5, -0.5, 0)
  702. LHW.C0 = CA(MR(-35), MR(60), MR(-45)) * CN(-0.6, 0.2, -0.24)
  703. wait()
  704. end
  705. for i = 0.25, 1, 0.25 do
  706. RAW.C0 = CA(MR(43-8*i), 0, MR(-15)) * CN(0, -0.2-0.2*i, 0)
  707. LAW.C0 = CA(MR(50), MR(40), MR(-15)) * CN(0.5, -0.5, 0)
  708. LHW.C0 = CA(MR(-35), MR(60), MR(-45)) * CN(-0.6, 0.2, -0.24)
  709. wait()
  710. end
  711. for i = 0.5, 1, 0.5 do
  712. RAW.C0 = CA(MR(35-2*i), 0, MR(-15)) * CN(0, -0.4-0.05*i, 0)
  713. wait()
  714. end
  715. local shel = Shell(Weapon)
  716. local w = Weld(Rarm, shel.Main, CN(0, -1.25, 0.45), CA(MR(-140), 0, MR(60)))
  717. for i = 0.25, 1, 0.25 do
  718. RAW.C0 = CA(MR(33+20*i), 0, MR(-15-10*i)) * CN(0, -0.45+0.2*i, 0)
  719. LAW.C0 = CA(MR(50-5*i), MR(40), MR(-15+5*i)) * CN(0.5, -0.5, 0)
  720. w.C0 = CN(-0.1*i, -1.25, 0.45-0.25*i)
  721. wait()
  722. end
  723. for i = 0.2, 1, 0.2 do
  724. RAW.C0 = CA(MR(53+32*i), 0, MR(-25-12*i)) * CN(0, -0.25-0.3*i, 0)
  725. LAW.C0 = CA(MR(45), MR(40), MR(-10+10*i)) * CN(0.5, -0.5+0.15*i, 0)
  726. w.C0 = CN(-0.1-0.1*i, -1.25, 0.2-0.3*i)
  727. w.C1 = CA(MR(-140+50*i), 0, MR(60))
  728. wait()
  729. end
  730. PlaySound(Sounds.Reload, false)
  731. for i = 0.25, 1, 0.25 do
  732. RAW.C0 = CA(MR(85+10*i), 0, MR(-42-8*i)) * CN(0, -0.55-0.1*i, 0)
  733. LAW.C0 = CA(MR(45), MR(40), 0) * CN(0.5, -0.35, 0)
  734. w.C0 = CN(-0.2-0.05*i, -1.25, -0.1-0.1*i)
  735. wait()
  736. end
  737. shel.Model:remove() shell = nil
  738. Ammunition.Ammo = Ammunition.Ammo + 1
  739. Ammunition.Ammoleft = Ammunition.Ammoleft - 1
  740. wait(0.1)
  741. for i = 0.33, 1, 0.33 do
  742. RAW.C0 = CA(MR(95-10*i), 0, MR(-50+10*i)) * CN(0, -0.65+0.1*i, 0)
  743. LAW.C0 = CA(MR(45+5*i), MR(40), MR(-12*i)) * CN(0.5, -0.35-0.1*i, 0)
  744. wait()
  745. end
  746. for i = 0.25, 1, 0.25 do
  747. RAW.C0 = CA(MR(85-40*i), 0, MR(-40+25*i)) * CN(0, -0.55+0.4*i, 0)
  748. LAW.C0 = CA(MR(50), MR(40), MR(-12-3*i)) * CN(0.5, -0.45-0.05*i, 0)
  749. wait()
  750. end
  751. if once then break end
  752. if not ReloadHold then break end
  753. end
  754. for i = 0.33, 1, 0.33 do
  755. RAW.C0 = CA(MR(45+10*i), 0, MR(-15-10*i)) * CN(0.1*i, -0.15-0.1*i, 0)
  756. LAW.C0 = CA(MR(52+12*i), MR(40-5*i), MR(-15-5*i)) * CN(0.5, -0.5, 0)
  757. LHW.C0 = CA(MR(-35+10*i), MR(60-10*i), MR(-45+10*i)) * CN(-0.6+0.1*i, 0.2, -0.24)
  758. wait()
  759. end
  760. for i = 0.2, 1, 0.2 do
  761. RAW.C0 = CA(MR(55+30*i), 0, MR(-25-30*i)) * CN(0.1+0.4*i, -0.25-0.55*i, 0)
  762. LAW.C0 = CA(MR(70+10*i), MR(35-30*i), MR(-20-15*i)) * CN(0.5, -0.5, 0)
  763. LHW.C0 = CA(MR(-25+18*i), MR(50-15*i), MR(-35+25*i)) * CN(-0.5+0.3*i, 0.2+0.1*i, -0.24)
  764. wait()
  765. end
  766. for i = 0.25, 1, 0.25 do
  767. RAW.C0 = CA(MR(85+5*i), 0, MR(-55-10*i)) * CN(0.5+0.1*i, -0.8-0.1*i, 0)
  768. LAW.C0 = CA(MR(80+5*i), MR(5-5*i), MR(-35-5*i)) * CN(0.5, -0.5, 0)
  769. LHW.C0 = CA(MR(-7+5*i), MR(35-5*i), MR(-10+7*i)) * CN(-0.2+0.1*i, 0.3+0.02*i, -0.24)
  770. wait()
  771. end
  772. end
  773. function ReloadStart(once)
  774. Reloading = true
  775. HW.Part1 = nil
  776. LHW.Part1 = Pipe2
  777. for i = 0.25, 1, 0.25 do
  778. RAW.C0 = CA(MR(90-10*i), 0, MR(-65+10*i)) * CN(0.6-0.2*i, -0.9+0.15*i, 0)
  779. LAW.C0 = CA(MR(85-5*i), MR(7*i), MR(-40+5*i)) * CN(0.5, -0.5, 0)
  780. LHW.C0 = CA(MR(-2-8*i), MR(30+5*i), MR(-3-12*i)) * CN(-0.1-0.1*i, 0.32-0.12*i, -0.24)
  781. wait()
  782. end
  783. for i = 0.15, 1, 0.15 do
  784. RAW.C0 = CA(MR(80-35*i), 0, MR(-55+40*i)) * CN(0.4-0.4*i, -0.75+0.6*i, 0)
  785. LAW.C0 = CA(MR(80-30*i), MR(7+33*i), MR(-35+20*i)) * CN(0.5, -0.5, 0)
  786. LHW.C0 = CA(MR(-10-25*i), MR(35+25*i), MR(-15-30*i)) * CN(-0.2-0.4*i, 0.2, -0.24)
  787. wait()
  788. end
  789. Reload(once)
  790. Normal()
  791. Reloading = false
  792. end
  793. function AimEet()
  794. end
  795. function Shoot(Start, To)
  796. local Accu = CA(MR(MRA(-Accuracy.Momentum*1000, Accuracy.Momentum*1000)/1700), MR(MRA(-Accuracy.Momentum*1000, Accuracy.Momentum*1000)/1000), MR(MRA(-Accuracy.Momentum*1000, Accuracy.Momentum*1000)/1000))
  797. for Pellets = 1, 8 do
  798. local Power = 20
  799. local Drop = 0.2
  800. local Face = CN(Start, To) * Accu * CA(MR(MRA(-10000, 10000)/2500), MR(MRA(-10000, 10000)/2500), MR(MRA(-10000, 10000)/2500))
  801. local Pellet = Part(PelletModel, true, false, 0, 0, BN("Dark grey"), V3(0.2, 0.2, 0.3))
  802. Pellet.CFrame = Face
  803. local LastPoint = Face.p
  804. Notime(function()
  805. local HitObj
  806. local HitPos
  807. local DistThing = 250
  808. for Distance = Power, 600, Power do
  809. Face = Face * CA(MR(-Drop), 0, 0) * CN(0, 0, -Power)
  810. local PointNow = Face.p
  811. local Hit, Pos = RayC(LastPoint, PointNow, Power+2, EffectModel)
  812. if Hit then
  813. DistThing = Distance
  814. if DistThing > 250 then DistThing = 200 end
  815. PointNow = Pos
  816. HitPos = Pos
  817. HitObj = Hit
  818. end
  819. local Dist = (PointNow - LastPoint).magnitude
  820. Pellet.CFrame = Face
  821. Drop = Drop + 0.04
  822. local Effect = Part(EffectModel, true, false, 0, 0, BN("New Yeller"), V3(0.2, 0.2, 0.2))
  823. Effect.CFrame = CN(LastPoint, PointNow) * CA(MR(-90), 0, 0) * CN(0, Dist/2, 0)
  824. local H = Add.Head(Effect, V3(0.8, Dist*5, 0.8))
  825. LastPoint = Face.p
  826. Power = Power - Drop/3
  827. Notime(function()
  828. for i = 0, 1, 0.2 do
  829. wait()
  830. Effect.Transparency = i
  831. end
  832. Effect:remove()
  833. end)
  834. if Hit then
  835. Pellet.CFrame = CN(Pos)
  836. break
  837. end
  838. wait()
  839. end
  840. Pellet:remove()
  841. if HitObj then
  842. local Surface = DetectSurface(HitPos, HitObj)
  843. local C = CN(HitPos) * CA(HitObj.CFrame:toEulerAnglesXYZ()) * Surface[2]
  844. if Surface[1] == "Anything" then
  845. C = Surface[2]
  846. end
  847. local H = nil
  848. if HitObj.Parent ~= workspace then
  849. H = GetHum(HitObj.Parent)
  850. if HitObj.Parent.Parent ~= workspace and H == nil then
  851. H = GetHum(HitObj.Parent.Parent)
  852. end
  853. end
  854. if H then
  855. local Dmg = DistThing/200
  856. Dmg = (1-Dmg)*10000
  857. Dmg = MRA(Dmg*850, Dmg*1100)/1000
  858. H.Health = H.Health - Dmg
  859. PlaySound(Sounds.Hit)
  860. Show_Damage(HitObj.Position, math.floor(Dmg), 10000.0)
  861. else
  862. PlaySound(Sounds.PartHit)
  863. local BulletHole = Part(EffectModel, true, false, 1, 0, BN("New Yeller"), V3(0.8, 0.2, 0.8))
  864. BulletHole.CFrame = C * CN(0, -0.085, 0)
  865. local Dec = Instance.new("Decal",BulletHole)
  866. Dec.Texture = Images[MRA(1,#Images)]
  867. Dec.Face = "Top"
  868. if not HitObj.Anchored then
  869. BulletHole.Anchored = false
  870. local W = Weld(HitObj, BulletHole, HitObj.CFrame:toObjectSpace(C))
  871. end
  872. Notime(function()
  873. wait(MRA(700, 15000)/100)
  874. BulletHole:remove()
  875. end)
  876. end
  877. end
  878. end)
  879. end
  880. end
  881. function ShootAnim(From, To)
  882. Shoot(From, To)
  883. AddInaccuracy(16)
  884. PlaySound(Sounds.Fire, false)
  885. for i = 0.33, 1, 0.33 do
  886. RAW.C0 = CA(MR(90+10*i), 0, MR(-65)) * CN(0.6, -0.9+0.5*i, 0)
  887. LAW.C0 = CA(MR(85+26*i), 0, MR(-40)) * CN(0.5, -0.5+0.1*i, 0)
  888. HW.C0 = CA(MR(-15*i), MR(5), MR(0)) * CN(0.4, 0, -1.2)
  889. wait()
  890. end
  891. for i = 0.2, 1, 0.2 do
  892. RAW.C0 = CA(MR(100+5*i), 0, MR(-65)) * CN(0.6, -0.4+0.15*i, 0)
  893. LAW.C0 = CA(MR(111+4*i), 0, MR(-40)) * CN(0.5, -0.4+0.05*i, 0)
  894. HW.C0 = CA(MR(-15-2*i), MR(5), MR(0)) * CN(0.4, 0, -1.2)
  895. wait()
  896. end
  897. for i = 0.5, 1, 0.5 do
  898. RAW.C0 = CA(MR(105+2*i), 0, MR(-65)) * CN(0.6, -0.25+0.03*i, 0)
  899. LAW.C0 = CA(MR(115+2*i), 0, MR(-40)) * CN(0.5, -0.35+0.02*i, 0)
  900. HW.C0 = CA(MR(-17), MR(5), MR(0)) * CN(0.4, 0, -1.2)
  901. wait()
  902. end
  903. for i = 0.2, 1, 0.2 do
  904. RAW.C0 = CA(MR(107-12*i), 0, MR(-65)) * CN(0.6, -0.22-0.68*i, 0)
  905. LAW.C0 = CA(MR(117-17*i), 0, MR(-40)) * CN(0.5, -0.33-0.02*i, 0)
  906. HW.C0 = CA(MR(-17+2*i), MR(5), MR(0)) * CN(0.4, 0, -1.2)
  907. wait()
  908. end
  909. for i = 0.33, 1, 0.33 do
  910. RAW.C0 = CA(MR(95-5*i), 0, MR(-65)) * CN(0.6, -0.9-0.1*i, 0)
  911. LAW.C0 = CA(MR(100-5*i), 0, MR(-40)) * CN(0.5+0.1*i, -0.35+0.1*i, 0)
  912. HW.C0 = CA(MR(-15+11*i), MR(5), MR(0)) * CN(0.4, 0, -1.2)
  913. PumpWeld.C1 = CN(0, 0, 0.1*i)
  914. wait()
  915. end
  916. for i = 0.33, 1, 0.33 do
  917. RAW.C0 = CA(MR(90-3*i), 0, MR(-65)) * CN(0.6, -1+0.05*i, 0)
  918. LAW.C0 = CA(MR(95-5*i), 0, MR(-40)) * CN(0.6+0.2*i, -0.25+0.35*i, 0)
  919. HW.C0 = CA(MR(-4+4*i), MR(5), MR(0)) * CN(0.4, 0, -1.2)
  920. PumpWeld.C1 = CN(0, 0, 0.1+0.6*i)
  921. Flip.C1 = CN(0, 0, 0.5*i)
  922. wait()
  923. end
  924. local sh = Shell(workspace)
  925. sh.Main.CanCollide = true
  926. sh.Back.CanCollide = true
  927. sh.Main.CFrame = Handle3.CFrame * CN(0.3, 0.2, 0)
  928. sh.Main.Velocity = (Handle3.CFrame * CA(0, MR(90), 0)).lookVector * 15
  929. Notime(function()
  930. wait(MRA(100,180)/10)
  931. for i = 0, 1, 0.005 do
  932. sh.Main.Transparency = i
  933. sh.Back.Transparency = i
  934. wait()
  935. end
  936. sh.Model:remove()
  937. end)
  938. for i = 0.33, 1, 0.33 do
  939. RAW.C0 = CA(MR(87+3*i), 0, MR(-65)) * CN(0.6, -0.95+0.05*i, 0)
  940. LAW.C0 = CA(MR(90-5*i), 0, MR(-40)) * CN(0.8-0.3*i, 0.1-0.6*i, 0)
  941. HW.C0 = CA(0, MR(5), 0) * CN(0.4, 0, -1.2)
  942. PumpWeld.C1 = CN(0, 0, 0.7-0.7*i)
  943. Flip.C1 = CN(0, 0, 0.5-0.5*i)
  944. wait()
  945. end
  946. Normal()
  947. end
  948. function ShootFunc(From, To)
  949. local H, Pos = RayC(From, To, 10, EffectModel)
  950. local Can = true
  951. if H then
  952. if H:IsDescendantOf(Char) then
  953. Can = false
  954. end
  955. end
  956. if Can then
  957. Attacking = true
  958. Ammunition.Ammo = Ammunition.Ammo - 1
  959. if Ammunition.Ammo < 0 then Ammunition.Ammo = 0 end
  960. ShootAnim(From, To)
  961. Attacking = false
  962. end
  963. end
  964. function SelectAnim()
  965. RAW.Part1 = Rarm
  966. for i = 0.25, 1, 0.25 do
  967. RAW.C0 = CA(MR(-10*i), 0, MR(2*i))
  968. wait()
  969. end
  970. for i = 0.1, 1, 0.1 do
  971. RAW.C0 = CN(-0.15*i, 0, -0.45*i) * CA(MR(-10-115*i), 0, MR(2+8*i)) * CN(0, -0.4*i, 0)
  972. wait()
  973. end
  974. for i = 0.25, 1, 0.25 do
  975. RAW.C0 = CN(-0.15, 0, -0.45-0.05*i) * CA(MR(-125-15*i), 0, MR(10)) * CN(0, -0.4, 0)
  976. wait()
  977. end
  978. TW.Part1 = nil
  979. HW.Part1 = Handle
  980. for i = 0.25, 1, 0.25 do
  981. RAW.C0 = CN(-0.15+0.15*i, 0, -0.5+0.1*i) * CA(MR(-140+10*i), 0, MR(10+2*i)) * CN(0, -0.4+0.15*i, 0)
  982. HW.C0 = CA(MR(38+12*i), MR(-28-15*i), MR(-90-10*i)) * CN(0, -0.1*i, -3.8)
  983. wait()
  984. end
  985. Attach(FTorso)
  986. for i = 0.1, 1, 0.1 do
  987. RAW.C0 = CN(0, 0, -0.4+0.3*i) * CA(MR(-130+90*i), 0, MR(12+30*i)) * CN(0, -0.25+0.25*i, 0)
  988. HW.C0 = CA(MR(50+30*i), MR(-43-50*i), MR(-100-50*i)) * CN(0, -0.1-0.7*i, -3.8+0.7*i)
  989. FW.C0 = CA(0, MR(-15*i), 0)
  990. wait()
  991. end
  992. LAW.Part1 = Larm
  993. for i = 0.15, 1, 0.15 do
  994. RAW.C0 = CN(0, 0, -0.1+0.1*i) * CA(MR(-40+60*i), 0, MR(42+4*i))
  995. LAW.C0 = CA(MR(10*i), 0, MR(-8*i)) * CN(0, -0.15*i, 0)
  996. FW.C0 = CA(0, MR(-15-20*i), 0)
  997. HW.C0 = CA(MR(80+50*i), MR(-93-57*i), MR(-150-30*i)) * CN(0, -0.8, -3.1+1*i)
  998. wait()
  999. end
  1000. for i = 0.15, 1, 0.15 do
  1001. RAW.C0 = CA(MR(20+58*i), 0, MR(46-60*i)) * CN(0.2*i, -0.35*i, 0)
  1002. LAW.C0 = CA(MR(10+65*i), 0, MR(-8-32*i)) * CN(0.3*i, -0.15-0.25*i, 0)
  1003. FW.C0 = CA(0, MR(-35-30*i), 0)
  1004. HW.C0 = CA(MR(130+50*i), MR(-150-20*i), MR(-180)) * CN(0.25*i, -0.8+0.3*i, -2.1+0.9*i)
  1005. wait()
  1006. end
  1007. for i = 0.2, 1, 0.2 do
  1008. RAW.C0 = CA(MR(78+8*i), 0, MR(-14-41*i)) * CN(0.2+0.35*i, -0.35-0.55*i, 0)
  1009. LAW.C0 = CA(MR(75+7*i), 0, MR(-40)) * CN(0.3+0.15*i, -0.4-0.06*i, 0)
  1010. FW.C0 = CA(0, MR(-65-5*i), 0)
  1011. HW.C0 = CA(MR(0), MR(-10+10*i), MR(0)) * CN(0.25+0.1*i, -0.5+0.4*i, -1.2)
  1012. wait()
  1013. end
  1014. for i = 0.25, 1, 0.25 do
  1015. RAW.C0 = CA(MR(86+4*i), 0, MR(-55-10*i)) * CN(0.55+0.05*i, -0.8-0.1*i, 0)
  1016. LAW.C0 = CA(MR(82+3*i), 0, MR(-40)) * CN(0.45+0.05*i, -0.46-0.04*i, 0)
  1017. FW.C0 = CA(0, MR(-70), 0)
  1018. HW.C0 = CA(MR(0), MR(5*i), MR(0)) * CN(0.35+0.05*i, -0.1+0.1*i, -1.2)
  1019. wait()
  1020. end
  1021. end
  1022. function DeselAnim()
  1023. for i = 0.25, 1, 0.25 do
  1024. RAW.C0 = CA(MR(90-10*i), 0, MR(-65+10*i)) * CN(0.6-0.05*i, -0.9+0.35*i, 0)
  1025. LAW.C0 = CA(MR(85-10*i), 0, MR(-40+4*i)) * CN(0.5-0.05*i, -0.5+0.04*i, 0)
  1026. FW.C0 = CA(0, MR(-70+10*i), 0)
  1027. HW.C0 = CA(MR(180-10*i), MR(-185+10*i), MR(180-10*i)) * CN(0.4-0.05*i, -0.1*i, -1.2)
  1028. wait()
  1029. end
  1030. for i = 0.07, 1, 0.07 do
  1031. RAW.C0 = CA(MR(80-80*i), 0, MR(-55+90*i)) * CN(0.55-0.35*i, -0.55+0.55*i, 0)
  1032. LAW.C0 = CA(MR(75-70*i), 0, MR(-36+30*i)) * CN(0.45-0.35*i, -0.46+0.36*i, 0)
  1033. FW.C0 = CA(0, MR(-60+40*i), 0)
  1034. HW.C0 = CA(MR(170-70*i), MR(-175+70*i), MR(170-70*i)) * CN(0.35-0.35*i, -0.1-0.1*i, -1.2-1*i)
  1035. wait()
  1036. end
  1037. for i = 0.25, 1, 0.25 do
  1038. RAW.C0 = CN(-0.1*i, 0, -0.15*i) * CA(MR(-30*i), 0, MR(35+10*i)) * CN(0.2-0.2*i, 0, 0)
  1039. LAW.C0 = CA(MR(5-5*i), 0, MR(-6+6*i)) * CN(0.1-0.1*i, -0.1+0.1*i, 0)
  1040. FW.C0 = CA(0, MR(-20+15*i), 0)
  1041. HW.C0 = CA(MR(100-20*i), MR(-105+15*i), MR(100-15*i)) * CN(0, -0.2, -2.2-0.3*i)
  1042. wait()
  1043. end
  1044. LAW.Part1 = nil
  1045. for i = 0.12, 1, 0.12 do
  1046. RAW.C0 = CN(-0.1-0.05*i, 0, -0.15-0.3*i) * CA(MR(-30-100*i), 0, MR(45-30*i)) * CN(0, -0.3*i, 0)
  1047. FW.C0 = CA(0, MR(-5+5*i), 0)
  1048. HW.C0 = CA(MR(80-37*i), MR(-90+55*i), MR(85-135*i)) * CN(0, -0.2, -2.5-0.9*i)
  1049. wait()
  1050. end
  1051. Attach(Torso)
  1052. for i = 0.2, 1, 0.2 do
  1053. RAW.C0 = CN(-0.15*i, 0, -0.45-0.05*i) * CA(MR(-130-10*i), 0, MR(15-5*i)) * CN(0, -0.3-0.1*i, 0)
  1054. HW.C0 = CA(MR(43-5*i), MR(-35+7*i), MR(-50-40*i)) * CN(0, -0.2, -3.4-0.4*i)
  1055. wait()
  1056. end
  1057. TW.Part1 = Handle
  1058. HW.Part1 = nil
  1059. for i = 0.25, 1, 0.25 do
  1060. RAW.C0 = CN(-0.15+0.05*i, 0, -0.5+0.15*i) * CA(MR(-140+10*i), 0, MR(10-3*i)) * CN(0, -0.4+0.1*i, 0)
  1061. wait()
  1062. end
  1063. for i = 0.15, 1, 0.15 do
  1064. RAW.C0 = CN(-0.1+0.1*i, 0, -0.35+0.25*i) * CA(MR(-130+115*i), 0, MR(7-7*i)) * CN(0, -0.3+0.25*i, 0)
  1065. wait()
  1066. end
  1067. for i = 0.33, 1, 0.33 do
  1068. RAW.C0 = CN(0, 0, -0.1+0.1*i) * CA(MR(-15+15*i), 0, 0) * CN(0, -0.05+0.05*i, 0)
  1069. wait()
  1070. end
  1071. Attach(Torso)
  1072. TW.Part1 = Handle
  1073. HW.Part1 = nil
  1074. RAW.Part1 = nil
  1075. LAW.Part1 = nil
  1076. end
  1077. function ReloadFunc(once)
  1078. if Ammunition.Ammo < Ammunition.MaxAmmo and Selected and not Reloading and not Attacking and Ammunition.Ammoleft > 0 then
  1079. if not once then
  1080. ReloadHold = true
  1081. end
  1082. ReloadStart(once)
  1083. end
  1084. end
  1085. function onSelected(mouse)
  1086. SelectAnim()
  1087. mouse.Icon = Icon
  1088. Selected = true
  1089. Notime(function()
  1090. for _, g in pairs(AccuracyGuis) do
  1091. g.Gui.Transparency = 0.2
  1092. end
  1093. while Selected do
  1094. pcall(function()
  1095. for _, g in pairs(AccuracyGuis) do
  1096. g.Gui.Position = UD(0, mouse.X+g.props.offset.x+g.props.unit.x*(Accuracy.Momentum*11), 0, mouse.Y+g.props.offset.y+g.props.unit.y*(Accuracy.Momentum*11))
  1097. end
  1098. end)
  1099. wait()
  1100. end
  1101. end)
  1102. mouse.Button1Down:connect(function()
  1103. if Selected and not Attacking and not Swinging then
  1104. if Reloading then
  1105. ReloadHold = false
  1106. else
  1107. if Ammunition.Ammo < 1 then
  1108. ReloadFunc(true)
  1109. else
  1110. ShootFunc((Pipe1.CFrame * CN(0, 0, 1.65)).p, mouse.Hit.p)
  1111. end
  1112. if Ammunition.Ammo < 1 and Ammunition.Ammoleft < 1 then
  1113. PlaySound(Sounds.Out)
  1114. end
  1115. end
  1116. end
  1117. end)
  1118. mouse.KeyDown:connect(function(key)
  1119. key = key:lower()
  1120. if Selected and not Attacking and not Swinging then
  1121. if key == "r" then
  1122. ReloadFunc()
  1123. elseif key == "e" then
  1124. Swing()
  1125. end
  1126. end
  1127. end)
  1128. mouse.KeyUp:connect(function(key)
  1129. key = key:lower()
  1130. if key == "r" then
  1131. ReloadHold = false
  1132. end
  1133. end)
  1134. end
  1135. function onDeselected(mouse)
  1136. Selected = false
  1137. for _, g in pairs(AccuracyGuis) do
  1138. g.Gui.Transparency = 1
  1139. end
  1140. DeselAnim()
  1141. end
  1142. bin.Selected:connect(onSelected)
  1143. bin.Deselected:connect(onDeselected)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement