Advertisement
battleman22222

VSS

Jun 30th, 2017
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 38.65 KB | None | 0 0
  1. -[[
  2. VSS Vintorez
  3. Used by the Russian Spetsnaz in the late 1900s and early 2000s. Fires 10 9mm rounds.
  4. --]]
  5.  
  6.  
  7. if script == nil then return end
  8.  
  9.  
  10. ModelName = "VSS Vintorez"
  11. AmmoType = "9mm"
  12. MagazineCapacity = 10
  13. MagazineCapacityAdd = 1
  14. Player = script:FindFirstChild("Player") ~= nil and script.Player.Value or game:GetService("Players"):FindFirstChild("DarkShadow6Alt")
  15. Selected = false
  16. Connected = false
  17. Button1Down = false
  18. CanUse = true
  19. BulletData = [[Velocity_Transfer = 1.5
  20.  
  21. Damage_Head = 100
  22. Damage_Torso = 50
  23. Damage_Limb = 40
  24. Damage_Other = 20
  25.  
  26. Dust_Size_Min = 5
  27. Dust_Size_Max = 10
  28. Dust_Add = 0.05
  29.  
  30. Spark_Min = 15
  31. Spark_Max = 35
  32. Spark_Size_Min = 15
  33. Spark_Size_Max = 25
  34. Spark_Add = 0.1
  35.  
  36. Chunk_Min = 10
  37. Chunk_Max = 15
  38. ]] ..game:GetService("InsertService"):LoadAsset(60263276)["BulletData"].Value
  39. FirstPerson = [[FirstPersonOffset = CFrame.new(-0.1, -0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-10), 0)
  40. ]] ..game:GetService("InsertService"):LoadAsset(60568552)["FirstPerson"].Value
  41. MouseAim = game:GetService("InsertService"):LoadAsset(61527949)["MouseAim"].Value
  42. ScopeZoom = [=[ScopeZoomRange = 200
  43. ]=] ..game:GetService("InsertService"):LoadAsset(64175271)["ScopeZoom"].Value
  44. AmmoCounter = game:GetService("InsertService"):LoadAsset(66610412)["AmmoCounter"].Value
  45.  
  46.  
  47. function CheckPlayer()
  48. if Player.Character == nil then return false end
  49. if Player.Character:FindFirstChild("Torso") == nil or Player.Character:FindFirstChild("Right Arm") == nil or Player.Character:FindFirstChild("Left Arm") == nil or Player.Character:FindFirstChild("Humanoid") == nil then return false end
  50. if Player.Character.Humanoid.Health <= 0 then return false end
  51. return true
  52. end
  53.  
  54.  
  55. loadstring(game:GetService("InsertService"):LoadAsset(65363615)["tagHumanoid"].Value)()
  56.  
  57.  
  58. loadstring(game:GetService("InsertService"):LoadAsset(63178291)["CameraPunch"].Value)()
  59.  
  60.  
  61. loadstring(game:GetService("InsertService"):LoadAsset(62991657)["PacketFunctions"].Value)()
  62.  
  63.  
  64. function CreateParts(Parent, Format)
  65. if Parent == nil then return end
  66. local Parts = Instance.new("Model")
  67. Parts.Name = ModelName
  68. if Format == 1 then
  69. Parts.Name = Parts.Name.. " (Holstered)"
  70. end
  71. Parts.Parent = Parent
  72.  
  73. local MasterPart = Instance.new("Part")
  74. MasterPart.Name = "Handle"
  75. MasterPart.FormFactor = "Custom"
  76. MasterPart.Size = Vector3.new(1, 1, 1)
  77. MasterPart.BrickColor = BrickColor.new("Black")
  78. MasterPart.TopSurface = 0
  79. MasterPart.BottomSurface = 0
  80. MasterPart.Parent = Parts
  81. local Mesh = Instance.new("SpecialMesh")
  82. Mesh.MeshType = "Brick"
  83. Mesh.Scale = Vector3.new(0.3, 0.75, 0.4)
  84. Mesh.Parent = MasterPart
  85. local Weld = Instance.new("Weld")
  86. Weld.Part0 = MasterPart
  87. if Format == 1 then
  88. Weld.Part1 = Player.Character:FindFirstChild("Torso")
  89. Weld.C0 = CFrame.new(0.65, -0.7, 0.9) * CFrame.fromEulerAnglesXYZ(math.rad(5), math.rad(-90), 0)
  90. elseif Format == 2 then
  91. Weld.Part1 = Player.Character:FindFirstChild("Right Arm")
  92. Weld.C0 = CFrame.new(0, 1.4, 0.5)
  93. end
  94. Weld.Parent = Weld.Part0
  95.  
  96. local Part = Instance.new("Part")
  97. Part.Name = "ShellOut"
  98. Part.FormFactor = "Custom"
  99. Part.Size = Vector3.new(1, 1, 1)
  100. Part.Transparency = 1
  101. Part.TopSurface = 0
  102. Part.BottomSurface = 0
  103. Part.Parent = Parts
  104. local Weld = Instance.new("Weld")
  105. Weld.Part0 = Part
  106. Weld.Part1 = MasterPart
  107. Weld.C0 = CFrame.new(0, 0, 1) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  108. Weld.Parent = Part
  109.  
  110. local Part = Instance.new("Part")
  111. Part.Name = "Grip"
  112. Part.FormFactor = "Custom"
  113. Part.Size = Vector3.new(1, 1, 1)
  114. Part.BrickColor = BrickColor.new("Reddish brown")
  115. Part.Material = "Wood"
  116. Part.TopSurface = 0
  117. Part.BottomSurface = 0
  118. Part.Parent = Parts
  119. local Mesh = Instance.new("SpecialMesh")
  120. Mesh.MeshType = "Brick"
  121. Mesh.Scale = Vector3.new(0.29, 0.35, 0.9)
  122. Mesh.Parent = Part
  123. local Weld = Instance.new("Weld")
  124. Weld.Part0 = Part
  125. Weld.Part1 = MasterPart
  126. Weld.C0 = CFrame.new(0, -0.25, -0.6) * CFrame.fromEulerAnglesXYZ(math.rad(15), 0, 0)
  127. Weld.Parent = Part
  128.  
  129. local Part = Instance.new("Part")
  130. Part.Name = "Scope Base"
  131. Part.FormFactor = "Custom"
  132. Part.Size = Vector3.new(1, 1, 1)
  133. Part.BrickColor = BrickColor.new("Black")
  134. Part.TopSurface = 0
  135. Part.BottomSurface = 0
  136. Part.Parent = Parts
  137. local Mesh = Instance.new("SpecialMesh")
  138. Mesh.MeshType = "Brick"
  139. Mesh.Scale = Vector3.new(0.1, 0.3, 0.1)
  140. Mesh.Parent = Part
  141. local Weld = Instance.new("Weld")
  142. Weld.Part0 = Part
  143. Weld.Part1 = MasterPart
  144. Weld.C0 = CFrame.new(0, 0, 0.25)
  145. Weld.Parent = Part
  146.  
  147. local Part = Instance.new("Part")
  148. Part.Name = "Scope End 1"
  149. Part.FormFactor = "Custom"
  150. Part.Size = Vector3.new(1, 1, 1)
  151. Part.BrickColor = BrickColor.new("Black")
  152. Part.TopSurface = 0
  153. Part.BottomSurface = 0
  154. Part.Parent = Parts
  155. local Mesh = Instance.new("CylinderMesh")
  156. Mesh.Scale = Vector3.new(0.275, 0.375, 0.275)
  157. Mesh.Parent = Part
  158. local Weld = Instance.new("Weld")
  159. Weld.Part0 = Part
  160. Weld.Part1 = MasterPart
  161. Weld.C0 = CFrame.new(0, -0.4, 0.375)
  162. Weld.Parent = Part
  163.  
  164. local Part = Instance.new("Part")
  165. Part.Name = "Scope End 2"
  166. Part.FormFactor = "Custom"
  167. Part.Size = Vector3.new(1, 1, 1)
  168. Part.BrickColor = BrickColor.new("Institutional white")
  169. Part.TopSurface = 0
  170. Part.BottomSurface = 0
  171. Part.Parent = Parts
  172. local Mesh = Instance.new("CylinderMesh")
  173. Mesh.Scale = Vector3.new(0.275, 0.025, 0.275)
  174. Mesh.Parent = Part
  175. local Weld = Instance.new("Weld")
  176. Weld.Part0 = Part
  177. Weld.Part1 = MasterPart
  178. Weld.C0 = CFrame.new(0, -0.6, 0.375)
  179. Weld.Parent = Part
  180.  
  181. local Part = Instance.new("Part")
  182. Part.Name = "Scope Center 1"
  183. Part.FormFactor = "Custom"
  184. Part.Size = Vector3.new(1, 1, 1)
  185. Part.BrickColor = BrickColor.new("Black")
  186. Part.TopSurface = 0
  187. Part.BottomSurface = 0
  188. Part.Parent = Parts
  189. local Mesh = Instance.new("CylinderMesh")
  190. Mesh.Scale = Vector3.new(0.15, 0.425, 0.15)
  191. Mesh.Parent = Part
  192. local Weld = Instance.new("Weld")
  193. Weld.Part0 = Part
  194. Weld.Part1 = MasterPart
  195. Weld.C0 = CFrame.new(0, 0, 0.375)
  196. Weld.Parent = Part
  197.  
  198. local Part = Instance.new("Part")
  199. Part.Name = "Scope Front 1"
  200. Part.FormFactor = "Custom"
  201. Part.Size = Vector3.new(1, 1, 1)
  202. Part.BrickColor = BrickColor.new("Black")
  203. Part.TopSurface = 0
  204. Part.BottomSurface = 0
  205. Part.Parent = Parts
  206. local Mesh = Instance.new("CylinderMesh")
  207. Mesh.Scale = Vector3.new(0.2, 0.75, 0.2)
  208. Mesh.Parent = Part
  209. local Weld = Instance.new("Weld")
  210. Weld.Part0 = Part
  211. Weld.Part1 = MasterPart
  212. Weld.C0 = CFrame.new(0, 0.575, 0.375)
  213. Weld.Parent = Part
  214.  
  215. local Part = Instance.new("Part")
  216. Part.Name = "Scope Front 2"
  217. Part.FormFactor = "Custom"
  218. Part.Size = Vector3.new(1, 1, 1)
  219. Part.BrickColor = BrickColor.new("Institutional white")
  220. Part.TopSurface = 0
  221. Part.BottomSurface = 0
  222. Part.Parent = Parts
  223. local Mesh = Instance.new("CylinderMesh")
  224. Mesh.Scale = Vector3.new(0.2, 0.01, 0.2)
  225. Mesh.Parent = Part
  226. local Weld = Instance.new("Weld")
  227. Weld.Part0 = Part
  228. Weld.Part1 = MasterPart
  229. Weld.C0 = CFrame.new(0, 0.95, 0.375)
  230. Weld.Parent = Part
  231.  
  232. local Part = Instance.new("Part")
  233. Part.Name = "Magazine Housing / Grip"
  234. Part.FormFactor = "Custom"
  235. Part.Size = Vector3.new(1, 1, 1)
  236. Part.BrickColor = BrickColor.new("Black")
  237. Part.TopSurface = 0
  238. Part.BottomSurface = 0
  239. Part.Parent = Parts
  240. local Mesh = Instance.new("SpecialMesh")
  241. Mesh.MeshType = "Brick"
  242. Mesh.Scale = Vector3.new(0.3, 1, 0.3)
  243. Mesh.Parent = Part
  244. local Weld = Instance.new("Weld")
  245. Weld.Part0 = Part
  246. Weld.Part1 = MasterPart
  247. Weld.C0 = CFrame.new(0, 0.7, -0.32) * CFrame.fromEulerAnglesXYZ(math.rad(-12.5), 0, 0)
  248. Weld.Parent = Part
  249.  
  250. local Part = Instance.new("Part")
  251. Part.Name = "Magazine"
  252. Part.FormFactor = "Custom"
  253. Part.Size = Vector3.new(1, 1, 1)
  254. Part.BrickColor = BrickColor.new("Black")
  255. Part.TopSurface = 0
  256. Part.BottomSurface = 0
  257. Part.Parent = Parts
  258. local Mesh = Instance.new("SpecialMesh")
  259. Mesh.MeshType = "Brick"
  260. Mesh.Scale = Vector3.new(0.25, 0.4, 0.6)
  261. Mesh.Parent = Part
  262. local Weld = Instance.new("Weld")
  263. Weld.Part0 = Part
  264. Weld.Part1 = MasterPart
  265. Weld.C0 = CFrame.new(0, 0.5, -0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-7.5), 0, 0)
  266. Weld.Parent = Part
  267.  
  268. local Part = Instance.new("Part")
  269. Part.Name = "Trigger Housing 1"
  270. Part.FormFactor = "Custom"
  271. Part.Size = Vector3.new(1, 1, 1)
  272. Part.BrickColor = BrickColor.new("Black")
  273. Part.TopSurface = 0
  274. Part.BottomSurface = 0
  275. Part.Parent = Parts
  276. local Mesh = Instance.new("SpecialMesh")
  277. Mesh.MeshType = "Brick"
  278. Mesh.Scale = Vector3.new(0.1, 0.5, 0.025)
  279. Mesh.Parent = Part
  280. local Weld = Instance.new("Weld")
  281. Weld.Part0 = Part
  282. Weld.Part1 = MasterPart
  283. Weld.C0 = CFrame.new(0, 0.075, -0.4)
  284. Weld.Parent = Part
  285.  
  286. local Part = Instance.new("Part")
  287. Part.Name = "Trigger Housing 2"
  288. Part.FormFactor = "Custom"
  289. Part.Size = Vector3.new(1, 1, 1)
  290. Part.BrickColor = BrickColor.new("Black")
  291. Part.TopSurface = 0
  292. Part.BottomSurface = 0
  293. Part.Parent = Parts
  294. local Mesh = Instance.new("SpecialMesh")
  295. Mesh.MeshType = "Brick"
  296. Mesh.Scale = Vector3.new(0.295, 0.1, 0.38)
  297. Mesh.Parent = Part
  298. local Weld = Instance.new("Weld")
  299. Weld.Part0 = Part
  300. Weld.Part1 = MasterPart
  301. Weld.C0 = CFrame.new(0, -0.15, -0.225)
  302. Weld.Parent = Part
  303.  
  304. local Part = Instance.new("Part")
  305. Part.Name = "Trigger"
  306. Part.FormFactor = "Custom"
  307. Part.Size = Vector3.new(1, 1, 1)
  308. Part.BrickColor = BrickColor.new("Black")
  309. Part.TopSurface = 0
  310. Part.BottomSurface = 0
  311. Part.Parent = Parts
  312. local Mesh = Instance.new("SpecialMesh")
  313. Mesh.MeshType = "Brick"
  314. Mesh.Scale = Vector3.new(0.1, 0.05, 0.15)
  315. Mesh.Parent = Part
  316. local Weld = Instance.new("Weld")
  317. Weld.Part0 = Part
  318. Weld.Part1 = MasterPart
  319. Weld.C0 = CFrame.new(0, 0.03, -0.275)
  320. Weld.Parent = Part
  321.  
  322. local Part = Instance.new("Part")
  323. Part.Name = "Barrel 1"
  324. Part.FormFactor = "Custom"
  325. Part.Size = Vector3.new(1, 1, 1)
  326. Part.BrickColor = BrickColor.new("Black")
  327. Part.TopSurface = 0
  328. Part.BottomSurface = 0
  329. Part.Parent = Parts
  330. local Mesh = Instance.new("SpecialMesh")
  331. Mesh.MeshType = "Brick"
  332. Mesh.Scale = Vector3.new(0.3, 0.925, 0.4)
  333. Mesh.Parent = Part
  334. local Weld = Instance.new("Weld")
  335. Weld.Part0 = Part
  336. Weld.Part1 = MasterPart
  337. Weld.C0 = CFrame.new(0, 0.825, 0)
  338. Weld.Parent = Part
  339.  
  340. local Part = Instance.new("Part")
  341. Part.Name = "Barrel 2"
  342. Part.FormFactor = "Custom"
  343. Part.Size = Vector3.new(1, 1, 1)
  344. Part.BrickColor = BrickColor.new("Black")
  345. Part.TopSurface = 0
  346. Part.BottomSurface = 0
  347. Part.Parent = Parts
  348. local Mesh = Instance.new("CylinderMesh")
  349. Mesh.Scale = Vector3.new(0.275, 2, 0.275)
  350. Mesh.Parent = Part
  351. local Weld = Instance.new("Weld")
  352. Weld.Part0 = Part
  353. Weld.Part1 = MasterPart
  354. Weld.C0 = CFrame.new(0, 2.25, 0)
  355. Weld.Parent = Part
  356.  
  357. local Part = Instance.new("Part")
  358. Part.Name = "Barrel Sight 1"
  359. Part.FormFactor = "Custom"
  360. Part.Size = Vector3.new(1, 1, 1)
  361. Part.BrickColor = BrickColor.new("Black")
  362. Part.TopSurface = 0
  363. Part.BottomSurface = 0
  364. Part.Parent = Parts
  365. local Mesh = Instance.new("SpecialMesh")
  366. Mesh.MeshType = "Brick"
  367. Mesh.Scale = Vector3.new(0.1, 0.3, 0.175)
  368. Mesh.Parent = Part
  369. local Weld = Instance.new("Weld")
  370. Weld.Part0 = Part
  371. Weld.Part1 = MasterPart
  372. Weld.C0 = CFrame.new(0, 1.4, 0.1)
  373. Weld.Parent = Part
  374.  
  375. local Part = Instance.new("Part")
  376. Part.Name = "Barrel Sight 2"
  377. Part.FormFactor = "Custom"
  378. Part.Size = Vector3.new(1, 1, 1)
  379. Part.BrickColor = BrickColor.new("Black")
  380. Part.TopSurface = 0
  381. Part.BottomSurface = 0
  382. Part.Parent = Parts
  383. local Mesh = Instance.new("SpecialMesh")
  384. Mesh.MeshType = "Brick"
  385. Mesh.Scale = Vector3.new(0.1, 0.1, 0.2)
  386. Mesh.Parent = Part
  387. local Weld = Instance.new("Weld")
  388. Weld.Part0 = Part
  389. Weld.Part1 = MasterPart
  390. Weld.C0 = CFrame.new(0, 3.2, 0.1)
  391. Weld.Parent = Part
  392.  
  393. local Part = Instance.new("Part")
  394. Part.Name = "Source"
  395. Part.FormFactor = "Custom"
  396. Part.Size = Vector3.new(0, 0, 0)
  397. Part.Transparency = 1
  398. Part.Parent = Parts
  399. local Weld = Instance.new("Weld")
  400. Weld.Part0 = Part
  401. Weld.Part1 = MasterPart
  402. Weld.C0 = CFrame.new(0, 3.25, 0)
  403. Weld.Parent = Part
  404.  
  405. local Part = Instance.new("Part")
  406. Part.Name = "Stock 1"
  407. Part.FormFactor = "Custom"
  408. Part.Size = Vector3.new(1, 1, 1)
  409. Part.BrickColor = BrickColor.new("Reddish brown")
  410. Part.Material = "Wood"
  411. Part.TopSurface = 0
  412. Part.BottomSurface = 0
  413. Part.Parent = Parts
  414. local Mesh = Instance.new("SpecialMesh")
  415. Mesh.MeshType = "Brick"
  416. Mesh.Scale = Vector3.new(0.3, 1.6, 0.125)
  417. Mesh.Parent = Part
  418. local Weld = Instance.new("Weld")
  419. Weld.Part0 = Part
  420. Weld.Part1 = MasterPart
  421. Weld.C0 = CFrame.new(0, -1.125, -0.93)
  422. Weld.Parent = Part
  423.  
  424. local Part = Instance.new("Part")
  425. Part.Name = "Stock 2"
  426. Part.FormFactor = "Custom"
  427. Part.Size = Vector3.new(1, 1, 1)
  428. Part.BrickColor = BrickColor.new("Reddish brown")
  429. Part.Material = "Wood"
  430. Part.TopSurface = 0
  431. Part.BottomSurface = 0
  432. Part.Parent = Parts
  433. local Mesh = Instance.new("SpecialMesh")
  434. Mesh.MeshType = "Brick"
  435. Mesh.Scale = Vector3.new(0.301, 1.6, 0.175)
  436. Mesh.Parent = Part
  437. local Weld = Instance.new("Weld")
  438. Weld.Part0 = Part
  439. Weld.Part1 = MasterPart
  440. Weld.C0 = CFrame.new(0, -1.125, -0.1125)
  441. Weld.Parent = Part
  442.  
  443. local Part = Instance.new("Part")
  444. Part.Name = "Stock 3"
  445. Part.FormFactor = "Custom"
  446. Part.Size = Vector3.new(1, 1, 1)
  447. Part.BrickColor = BrickColor.new("Reddish brown")
  448. Part.Material = "Wood"
  449. Part.TopSurface = 0
  450. Part.BottomSurface = 0
  451. Part.Parent = Parts
  452. local Mesh = Instance.new("SpecialMesh")
  453. Mesh.MeshType = "Brick"
  454. Mesh.Scale = Vector3.new(0.3, 0.2, 0.668)
  455. Mesh.Parent = Part
  456. local Weld = Instance.new("Weld")
  457. Weld.Part0 = Part
  458. Weld.Part1 = MasterPart
  459. Weld.C0 = CFrame.new(0, -1.825, -0.5335)
  460. Weld.Parent = Part
  461.  
  462. local Part = Instance.new("Part")
  463. Part.Name = "Stock 4"
  464. Part.FormFactor = "Custom"
  465. Part.Size = Vector3.new(1, 1, 1)
  466. Part.BrickColor = BrickColor.new("Reddish brown")
  467. Part.Material = "Wood"
  468. Part.TopSurface = 0
  469. Part.BottomSurface = 0
  470. Part.Parent = Parts
  471. local Mesh = Instance.new("SpecialMesh")
  472. Mesh.MeshType = "Brick"
  473. Mesh.Scale = Vector3.new(0.2, 0.2, 0.8)
  474. Mesh.Parent = Part
  475. local Weld = Instance.new("Weld")
  476. Weld.Part0 = Part
  477. Weld.Part1 = MasterPart
  478. Weld.C0 = CFrame.new(0, -1.1, -0.735) * CFrame.fromEulerAnglesXYZ(math.rad(10), 0, 0)
  479. Weld.Parent = Part
  480.  
  481. for _, Part in pairs(Parts:GetChildren()) do
  482. Part.Locked = true
  483. Part.CanCollide = false
  484. end
  485. end
  486.  
  487.  
  488. function RemoveParts(Parent, Format)
  489. if Format == 1 then
  490. pcall(function() Parent[ModelName.. " (Holstered)"]:Remove() end)
  491. elseif Format == 2 then
  492. pcall(function() Parent[ModelName]:Remove() end)
  493. end
  494. end
  495.  
  496.  
  497. function SetAngle(Joint, Angle, Character)
  498. if Character == nil then return false end
  499. local Joints = {
  500. Character.Torso:FindFirstChild("Right Shoulder 2"),
  501. Character.Torso:FindFirstChild("Left Shoulder 2"),
  502. Character.Torso:FindFirstChild("Right Hip 2"),
  503. Character.Torso:FindFirstChild("Left Hip 2")
  504. }
  505. if Joints[Joint] == nil then return false end
  506. if Joint == 1 or Joint == 3 then
  507. Joints[Joint].DesiredAngle = Angle
  508. end
  509. if Joint == 2 or Joint == 4 then
  510. Joints[Joint].DesiredAngle = -Angle
  511. end
  512. end
  513.  
  514.  
  515. function ForceAngle(Joint, Angle, Character)
  516. if Character == nil then return false end
  517. local Joints = {
  518. Character.Torso:FindFirstChild("Right Shoulder 2"),
  519. Character.Torso:FindFirstChild("Left Shoulder 2"),
  520. Character.Torso:FindFirstChild("Right Hip 2"),
  521. Character.Torso:FindFirstChild("Left Hip 2")
  522. }
  523. if Joints[Joint] == nil then return false end
  524. if Joint == 1 or Joint == 3 then
  525. Joints[Joint].DesiredAngle = Angle
  526. Joints[Joint].CurrentAngle = Angle
  527. end
  528. if Joint == 2 or Joint == 4 then
  529. Joints[Joint].DesiredAngle = -Angle
  530. Joints[Joint].CurrentAngle = -Angle
  531. end
  532. end
  533.  
  534.  
  535. function SetSpeed(Joint, Speed, Character)
  536. if Character == nil then return false end
  537. local Joints = {
  538. Character.Torso:FindFirstChild("Right Shoulder 2"),
  539. Character.Torso:FindFirstChild("Left Shoulder 2"),
  540. Character.Torso:FindFirstChild("Right Hip 2"),
  541. Character.Torso:FindFirstChild("Left Hip 2")
  542. }
  543. if Joints[Joint] == nil then return false end
  544. Joints[Joint].MaxVelocity = Speed
  545. end
  546.  
  547.  
  548. function DisableLimb(Limb, Character)
  549. if Character == nil then return false end
  550. if Character:FindFirstChild("Torso") == nil then return false end
  551. local Joints = {
  552. Character.Torso:FindFirstChild("Right Shoulder"),
  553. Character.Torso:FindFirstChild("Left Shoulder"),
  554. Character.Torso:FindFirstChild("Right Hip"),
  555. Character.Torso:FindFirstChild("Left Hip")
  556. }
  557. local Limbs = {
  558. Character:FindFirstChild("Right Arm"),
  559. Character:FindFirstChild("Left Arm"),
  560. Character:FindFirstChild("Right Leg"),
  561. Character:FindFirstChild("Left Leg")
  562. }
  563. if Joints[Limb] == nil then return false end
  564. if Limbs[Limb] == nil then return false end
  565. local Joint = Instance.new("Motor6D")
  566. Joint.Parent = Character.Torso
  567. Joint.Part0 = Character.Torso
  568. Joint.Part1 = Limbs[Limb]
  569. if Limb == 1 then
  570. Joint.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  571. Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  572. Joint.Name = "Right Shoulder 2"
  573. elseif Limb == 2 then
  574. Joint.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  575. Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  576. Joint.Name = "Left Shoulder 2"
  577. elseif Limb == 3 then
  578. Joint.C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  579. Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  580. Joint.Name = "Right Hip 2"
  581. elseif Limb == 4 then
  582. Joint.C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  583. Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  584. Joint.Name = "Left Hip 2"
  585. end
  586. Joint.MaxVelocity = Joints[Limb].MaxVelocity
  587. Joint.CurrentAngle = Joints[Limb].CurrentAngle
  588. Joint.DesiredAngle = Joints[Limb].DesiredAngle
  589. Joints[Limb]:Remove()
  590. end
  591.  
  592.  
  593. function ResetLimbCFrame(Limb, Character)
  594. if Character == nil then return false end
  595. if Character.Parent == nil then return false end
  596. if Character:FindFirstChild("Torso") == nil then return false end
  597. local Joints = {
  598. Character.Torso:FindFirstChild("Right Shoulder 2"),
  599. Character.Torso:FindFirstChild("Left Shoulder 2"),
  600. Character.Torso:FindFirstChild("Right Hip 2"),
  601. Character.Torso:FindFirstChild("Left Hip 2")
  602. }
  603. local Limbs = {
  604. Character:FindFirstChild("Right Arm"),
  605. Character:FindFirstChild("Left Arm"),
  606. Character:FindFirstChild("Right Leg"),
  607. Character:FindFirstChild("Left Leg")
  608. }
  609. if Joints[Limb] == nil then return false end
  610. if Limbs[Limb] == nil then return false end
  611. if Limb == 1 then
  612. Joints[Limb].C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  613. Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  614. elseif Limb == 2 then
  615. Joints[Limb].C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  616. Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  617. elseif Limb == 3 then
  618. Joints[Limb].C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  619. Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  620. elseif Limb == 4 then
  621. Joints[Limb].C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  622. Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  623. end
  624. end
  625.  
  626.  
  627. function EnableLimb(Limb, Character)
  628. if Character == nil then return false end
  629. if Character:FindFirstChild("Torso") == nil then return false end
  630. local Joints = {
  631. Character.Torso:FindFirstChild("Right Shoulder 2"),
  632. Character.Torso:FindFirstChild("Left Shoulder 2"),
  633. Character.Torso:FindFirstChild("Right Hip 2"),
  634. Character.Torso:FindFirstChild("Left Hip 2")
  635. }
  636. local Limbs = {
  637. Character:FindFirstChild("Right Arm"),
  638. Character:FindFirstChild("Left Arm"),
  639. Character:FindFirstChild("Right Leg"),
  640. Character:FindFirstChild("Left Leg")
  641. }
  642. if Joints[Limb] == nil then return false end
  643. if Limbs[Limb] == nil then return false end
  644. if Limb == 1 then
  645. Joints[Limb].Name = "Right Shoulder"
  646. elseif Limb == 2 then
  647. Joints[Limb].Name = "Left Shoulder"
  648. elseif Limb == 3 then
  649. Joints[Limb].Name = "Right Hip"
  650. elseif Limb == 4 then
  651. Joints[Limb].Name = "Left Hip"
  652. end
  653. Animate = Character:FindFirstChild("Animate")
  654. if Animate == nil then return false end
  655. Animate = Animate:Clone()
  656. Character.Animate:Remove()
  657. Animate.Parent = Character
  658. end
  659.  
  660.  
  661. function onButton1Down(Mouse)
  662. if Button1Down == true then return end
  663. Button1Down = true
  664. if CheckPlayer() == false then return end
  665. if CanUse == true then
  666. SoundToServer("Click", "http://www.roblox.com/Asset/?id=2697295", 15, 0.25, false, Player.Character[ModelName].Handle)
  667. if script.Magazine.Value <= 0 then
  668. return
  669. end
  670. CanUse = false
  671. SoundToServer("Fire", "http://www.roblox.com/Asset/?id=10209875", 7, 0.3, false, Player.Character[ModelName].Handle)
  672. script.Magazine.Value = script.Magazine.Value - 1
  673. local Bullet = Instance.new("Part", Workspace)
  674. Bullet.Name = "Bullet"
  675. Bullet.TopSurface = 0
  676. Bullet.BottomSurface = 0
  677. Bullet.BrickColor = BrickColor.new("Really black")
  678. Bullet.Locked = true
  679. Bullet.FormFactor = "Custom"
  680. Bullet.Size = Vector3.new(0.5, 0.5, 0.5)
  681. Bullet.CFrame = Player.Character[ModelName].Source.CFrame * CFrame.new(0, -2.5, 0)
  682. Bullet.Elasticity = 0
  683. Bullet.Friction = 0
  684. local Mesh = Instance.new("SpecialMesh", Bullet)
  685. Mesh.MeshType = "Sphere"
  686. Mesh.Scale = Vector3.new(0.25, 0.25, 0.25)
  687. tagHumanoid(Bullet)
  688. local BodyVelocity = Instance.new("BodyVelocity", Bullet)
  689. BodyVelocity.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  690. BodyVelocity.velocity = ((Mouse.Hit.p - Player.Character[ModelName].Source.Position).unit * 300) + Vector3.new(math.random(-1000, 1000) / 1000, math.random(-1000, 1000) / 1000, math.random(-1000, 1000) / 1000)
  691. game:GetService("Debris"):AddItem(Bullet, 10)
  692. TouchedToServer(BulletData, Bullet)
  693. CameraPunch(math.rad(5), 0)
  694. for i = 0, 10, 5 do
  695. pcall(function()
  696. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.5, 1.2, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(300), math.rad(10 + i), math.rad(-90))
  697. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.9, -0.35, 0.51) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0)
  698. end)
  699. wait()
  700. end
  701. for i = 10, 0, -5 do
  702. pcall(function()
  703. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.5, 1.2, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(300), math.rad(10 + i), math.rad(-90))
  704. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.9, -0.35, 0.51) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0)
  705. end)
  706. wait()
  707. end
  708. pcall(function()
  709. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.5, 1.2, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(300), math.rad(10), math.rad(-90))
  710. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.9, -0.35, 0.51) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), 0)
  711. end)
  712. wait(0.075)
  713. CanUse = true
  714. end
  715. end
  716.  
  717.  
  718. function onButton1Up(Mouse)
  719. Button1Down = false
  720. end
  721.  
  722.  
  723. function onKeyDown(Key, Mouse)
  724. if Selected == false then return end
  725. Key = Key:lower()
  726. if Button1Down == false and CanUse == true and CheckPlayer() == true then
  727. if Key == "q" then
  728. if Mouse.Target == nil then return end
  729. if CheckPlayer() == false then return end
  730. local NewPlayer = game:GetService("Players"):GetPlayerFromCharacter(Mouse.Target.Parent)
  731. if NewPlayer == nil then return end
  732. if NewPlayer.Character == nil then return end
  733. if NewPlayer.Character:FindFirstChild("Torso") == nil then return end
  734. if (NewPlayer.Character.Torso.Position - Player.Character.Torso.Position).magnitude > 10 then return end
  735. onDeselected(Mouse)
  736. wait()
  737. RemoveParts(Player.Character, 1)
  738. script.Parent.Parent = NewPlayer.Backpack
  739. Player = NewPlayer
  740. elseif Key == "r" then
  741. if script.Magazine.Value >= MagazineCapacity + MagazineCapacityAdd or Player.Backpack.Ammo[AmmoType].Value <= 0 then return end
  742. CanUse = false
  743. local Loaded = script.Magazine.Value > 0
  744. local Add = math.min(script.Magazine.Value, MagazineCapacityAdd)
  745. SoundToServer("Reload", "http://www.roblox.com/Asset/?id=2691591", 1, 1, false, Player.Character[ModelName].Handle)
  746. local Clone = Player.Character[ModelName].Magazine:Clone()
  747. Clone.CanCollide = false
  748. Clone.Parent = Workspace
  749. Player.Character[ModelName].Magazine.Transparency = 1
  750. local Weld = Instance.new("Weld")
  751. Weld.Part0 = Clone
  752. Weld.Part1 = Player.Character:FindFirstChild("Left Arm")
  753. Weld.C0 = CFrame.new(0, 1.1, 0)
  754. Weld.C1 = CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  755. Weld.Parent = Weld.Part0
  756. Player.Backpack.Ammo[AmmoType].Value = Player.Backpack.Ammo[AmmoType].Value + script.Magazine.Value - Add
  757. script.Magazine.Value = Add
  758. wait(0.2)
  759. for i = 0, 25, 2.5 do
  760. pcall(function()
  761. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  762. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.5 + (i / 60), 1.2 - (i / 20), 0.8 + (i / 35)) * CFrame.fromEulerAnglesXYZ(math.rad(300 - i), math.rad(10 + -i * 3.5), math.rad(-90))
  763. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  764. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.9, -0.35, 0.51) * CFrame.fromEulerAnglesXYZ(math.rad(-90 + i), math.rad(-5), 0)
  765. end)
  766. CameraPunch(math.rad(-1), 0)
  767. wait()
  768. end
  769. local Clone2 = Clone:Clone()
  770. Clone2.CanCollide = true
  771. Clone2.Parent = Workspace
  772. game:GetService("Debris"):AddItem(Clone2, 15)
  773. Clone.Transparency = 1
  774. wait(0.5)
  775. Clone.Transparency = 0
  776. for i = 25, 0, -2.5 do
  777. pcall(function()
  778. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.5 + ((i + 10) / 60), 1.2 - ((i + 10) / 20), 0.8 + (i / 35)) * CFrame.fromEulerAnglesXYZ(math.rad(300 - (i - 10)), math.rad(10 + -i * 3.5), math.rad(-90))
  779. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.9, -0.35, 0.51) * CFrame.fromEulerAnglesXYZ(math.rad(-90 + i), math.rad(-5), 0)
  780. end)
  781. CameraPunch(math.rad(1), 0)
  782. wait()
  783. end
  784. Player.Character[ModelName].Magazine.Transparency = 0
  785. Clone:Remove()
  786. if Player.Backpack.Ammo[AmmoType].Value - MagazineCapacity < 0 then
  787. script.Magazine.Value = Player.Backpack.Ammo[AmmoType].Value
  788. Player.Backpack.Ammo[AmmoType].Value = 0
  789. else
  790. script.Magazine.Value = script.Magazine.Value + MagazineCapacity
  791. Player.Backpack.Ammo[AmmoType].Value = Player.Backpack.Ammo[AmmoType].Value - MagazineCapacity
  792. end
  793. wait(0.3)
  794. if Loaded == false then
  795. wait(0.1)
  796. local Weld = Player.Character[ModelName].Handle.Weld
  797. Weld.Part1 = Player.Character:FindFirstChild("Left Arm")
  798. Weld.C0 = CFrame.new(-0.9, 0, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(10), math.rad(90), 0)
  799. Weld.C1 = CFrame.fromEulerAnglesXYZ(math.rad(50), 0, 0)
  800. for i = 0, 1, 0.1 do
  801. pcall(function()
  802. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.9 + (i / 10), -0.35 + (i * 1.5), 0.51 + (i / 8)) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), 0)
  803. end)
  804. CameraPunch(math.rad(0.1), 0)
  805. wait()
  806. end
  807. for i = 0, 1, 0.25 do
  808. pcall(function()
  809. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.8, 1.15 - (i / 5), 0.635) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), 0)
  810. end)
  811. CameraPunch(math.rad(-1), 0)
  812. wait()
  813. end
  814. for i = 1, 0, -0.25 do
  815. pcall(function()
  816. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.8, 1.15 - (i / 5), 0.635) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), 0)
  817. end)
  818. CameraPunch(math.rad(1), 0)
  819. wait()
  820. end
  821. for i = 1, 0, -0.1 do
  822. pcall(function()
  823. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.9 + (i / 10), -0.35 + (i * 1.5), 0.51 + (i / 8)) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), 0)
  824. end)
  825. CameraPunch(math.rad(-0.1), 0)
  826. wait()
  827. end
  828. else
  829. SendToServer([[for _, Part in pairs(Source:GetChildren()) do
  830. if Part.ClassName == "Sound" and Part.Name == "Reload" then
  831. coroutine.wrap(function()
  832. Part:Stop()
  833. Part.Volume = 0
  834. wait(1)
  835. Part:Remove()
  836. end)()
  837. end
  838. end]], "Sound Stop", {"Source", Player.Character[ModelName].Handle})
  839. wait(0.5)
  840. end
  841. pcall(function()
  842. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.5, 1.2, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(300), math.rad(10), math.rad(-90))
  843. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.9, -0.35, 0.51) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), 0)
  844. end)
  845. RemoveParts(Player.Character, 2)
  846. CreateParts(Player.Character, 2)
  847. UpdateFirstPerson(true)
  848. wait()
  849. CanUse = true
  850. elseif Key == "g" then
  851. CanUse = false
  852. SoundToServer("Slash", "rbxasset://sounds/swordslash.wav", 2, 1, false, Player.Character.Torso)
  853. for i = 0, 70, 15 do
  854. pcall(function()
  855. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.5, 1.2, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(300), math.rad(10 + i), math.rad(-90))
  856. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.9, -0.35, 0.51) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0)
  857. end)
  858. CameraPunch(math.rad(1), 0)
  859. wait()
  860. end
  861. local HasHit = false
  862. local _, HitConnection = pcall(function() return Player.Character[ModelName]["Barrel 1"].Touched:connect(function(Hit)
  863. if HasHit == true or Hit:IsDescendantOf(Player.Character) then return end
  864. HasHit = true
  865. SoundToServer("Bash", "http://www.roblox.com/Asset/?id=46153268", 1, 0.25, false, Player.Character.Torso)
  866. local Humanoid = Hit.Parent:FindFirstChild("Humanoid") or Hit.Parent.Parent:FindFirstChild("Humanoid")
  867. if Humanoid ~= nil then
  868. tagHumanoid(Humanoid)
  869. Humanoid:TakeDamage(17)
  870. wait()
  871. pcall(function() untagHumanoid(Humanoid) end)
  872. end
  873. end) end)
  874. for i = 70, -70, -25 do
  875. pcall(function()
  876. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.5, 1.2, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(300), math.rad(10 + i), math.rad(-90))
  877. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.9, -0.35, 0.51) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0)
  878. end)
  879. CameraPunch(math.rad(-3), 0)
  880. wait()
  881. end
  882. pcall(function() HitConnection:disconnect() end)
  883. for i = -70, -80, -2 do
  884. pcall(function()
  885. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.5, 1.2, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(300), math.rad(10 + i), math.rad(-90))
  886. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.9, -0.35, 0.51) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0)
  887. end)
  888. CameraPunch(math.rad(-1), 0)
  889. wait()
  890. end
  891. wait(0.05)
  892. for i = -80, 0, 5 do
  893. pcall(function()
  894. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.5, 1.2, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(300), math.rad(10 + i), math.rad(-90))
  895. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.9, -0.35, 0.51) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0)
  896. end)
  897. CameraPunch(math.rad(1), 0)
  898. wait()
  899. end
  900. pcall(function()
  901. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.5, 1.2, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(300), math.rad(10), math.rad(-90))
  902. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.9, -0.35, 0.51) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), 0)
  903. end)
  904. CanUse = true
  905. elseif Key == "t" then
  906. CanUse = false
  907. if ScopeZoomed == false then
  908. for i = 0, 1, 0.075 do
  909. pcall(function()
  910. Player.Character.Torso.Neck.C0 = CFrame.new(0.35 * i, 1 - (0.15 * i), 0.15 * i) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(21 * i), math.rad(180 - (18 * i)))
  911. end)
  912. wait()
  913. end
  914. pcall(function()
  915. Player.Character.Torso.Neck.C0 = CFrame.new(0.35, 0.85, 0.15) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(21), math.rad(162))
  916. end)
  917. end
  918. ScopeZoom(Mouse)
  919. CanUse = true
  920. if ScopeZoomed ~= false then
  921. coroutine.wrap(function()
  922. while ScopeZoomed ~= false do wait() end
  923. for i = 1, 0, -0.075 do
  924. pcall(function()
  925. Player.Character.Torso.Neck.C0 = CFrame.new(0.35 * i, 1 - (0.15 * i), 0.15 * i) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(21 * i), math.rad(180 - (18 * i)))
  926. end)
  927. wait()
  928. end
  929. pcall(function()
  930. Player.Character.Torso.Neck.C0 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-90), 0, math.rad(180))
  931. end)
  932. end)()
  933. end
  934. end
  935. end
  936. end
  937.  
  938.  
  939. function onSelected(Mouse)
  940. if Selected == true or CanUse == false then return end
  941. CanUse = false
  942. while true do
  943. if CheckPlayer() == true then
  944. if Player.Character.Torso:FindFirstChild("Right Shoulder") ~= nil and Player.Character.Torso:FindFirstChild("Left Shoulder") ~= nil then
  945. break
  946. end
  947. end
  948. wait(0.1)
  949. end
  950. Selected = true
  951. DisableLimb(1, Player.Character)
  952. SetSpeed(1, 0.5, Player.Character)
  953. SetAngle(1, 0, Player.Character)
  954. DisableLimb(2, Player.Character)
  955. SetSpeed(2, 0.5, Player.Character)
  956. SetAngle(2, 0, Player.Character)
  957. wait(0.1)
  958. SetSpeed(2, 0.1, Player.Character)
  959. ForceAngle(2, 0, Player.Character)
  960. SetAngle(2, math.rad(-50), Player.Character)
  961. CameraSlide(math.rad(-5), math.rad(4), 0.2)
  962. RemoveParts(Player.Character, 1)
  963. CreateParts(Player.Character, 2)
  964. local Weld = Player.Character[ModelName].Handle.Weld
  965. Weld.Part1 = Player.Character:FindFirstChild("Left Arm")
  966. Weld.C0 = CFrame.new(0.5, -0.25, -0.75) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0) * CFrame.fromEulerAnglesXYZ(math.rad(-50), 0, 0)
  967. SetAngle(2, 0, Player.Character)
  968. CameraSlide(math.rad(-6), math.rad(15), 0.15)
  969. pcall(function()
  970. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  971. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  972. end)
  973. for i = 0, 1, 0.05 do
  974. pcall(function()
  975. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new((-0.5 * i) + (1.5 * (1 - i)), 1.2 * i, 0.8 * i) * CFrame.fromEulerAnglesXYZ(math.rad(300 + ((1 - i) * 50)), math.rad(10), math.rad(-90) * i)
  976. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new((-0.9 * i) + (-1.5 * (1 - i)), -0.35 * i, 0.51 * i) * CFrame.fromEulerAnglesXYZ(math.rad(-90 * i), math.rad(-5 * i), 0)
  977. Weld.C0 = CFrame.new(0.5 - (i * (0.5 * 2)), -0.25 - (i * (-0.25 * 2)), -0.75 - (i * (-0.75 * 2))) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90 + (i * 180)), 0)
  978. Weld.C1 = CFrame.fromEulerAnglesXYZ(math.rad(50 - i * 25), 0, -math.rad(i * 15))
  979. end)
  980. CameraPunch(math.rad(0.6), math.rad(-1))
  981. wait()
  982. end
  983. pcall(function()
  984. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.5, 1.2, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(300), math.rad(10), math.rad(-90))
  985. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.9, -0.35, 0.51) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), 0)
  986. end)
  987. RemoveParts(Player.Character, 2)
  988. CreateParts(Player.Character, 2)
  989. UpdateFirstPerson(true)
  990. Mouse.Icon = "rbxasset://textures\\GunCursor.png"
  991. Mouse.Button1Down:connect(function() onButton1Down(Mouse) end)
  992. Mouse.Button1Up:connect(function() onButton1Up(Mouse) end)
  993. Mouse.KeyDown:connect(function(Key) onKeyDown(Key, Mouse) end)
  994. CanUse = true
  995. end
  996.  
  997.  
  998. function onDeselected(Mouse)
  999. if Selected == false then return end
  1000. Selected = false
  1001. while CanUse == false do wait() end
  1002. if CheckPlayer() == false or pcall(function() local _ = Player.Character.Torso["Right Shoulder 2"] end) == false then
  1003. RemoveParts(Player.Character, 2)
  1004. CreateParts(Player.Character, 1)
  1005. SetAngle(1, 0, Player.Character)
  1006. ResetLimbCFrame(1, Player.Character)
  1007. EnableLimb(1, Player.Character)
  1008. SetAngle(2, 0, Player.Character)
  1009. ResetLimbCFrame(2, Player.Character)
  1010. EnableLimb(2, Player.Character)
  1011. return
  1012. end
  1013. if Selected == true then return end
  1014. CanUse = false
  1015. local Weld = Player.Character[ModelName].Handle.Weld
  1016. Weld.Part1 = Player.Character:FindFirstChild("Left Arm")
  1017. Weld.C0 = CFrame.new(0.5, -0.25, -0.75) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  1018. Weld.C1 = CFrame.fromEulerAnglesXYZ(math.rad(25), 0, -math.rad(15))
  1019. for i = 1, 0, -0.05 do
  1020. pcall(function()
  1021. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new((-0.5 * i) + (1.5 * (1 - i)), 1.2 * i, 0.8 * i) * CFrame.fromEulerAnglesXYZ(math.rad(300 + ((1 - i) * 50)), math.rad(10), math.rad(-90) * i)
  1022. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new((-0.9 * i) + (-1.5 * (1 - i)), -0.35 * i, 0.51 * i) * CFrame.fromEulerAnglesXYZ(math.rad(-90 * i), math.rad(-5 * i), 0)
  1023. Weld.C0 = CFrame.new(0.5 - (i * (0.5 * 2)), -0.25 - (i * (-0.25 * 2)), -0.75 - (i * (-0.75 * 2))) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90 + (i * 180)), 0)
  1024. Weld.C1 = CFrame.fromEulerAnglesXYZ(math.rad(50 - i * 25), 0, -math.rad(i * 15))
  1025. end)
  1026. CameraPunch(math.rad(-0.6), math.rad(1))
  1027. wait()
  1028. end
  1029. Weld.C0 = CFrame.new(0.5, -0.25, -0.75) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0) * CFrame.fromEulerAnglesXYZ(math.rad(-50), 0, 0)
  1030. Weld.C1 = CFrame.new()
  1031. ResetLimbCFrame(1, Player.Character)
  1032. ResetLimbCFrame(2, Player.Character)
  1033. EnableLimb(1, Player.Character)
  1034. EnableLimb(2, Player.Character)
  1035. DisableLimb(2, Player.Character)
  1036. SetSpeed(2, 0.1, Player.Character)
  1037. ForceAngle(2, 0, Player.Character)
  1038. SetAngle(2, math.rad(-50), Player.Character)
  1039. CameraSlide(math.rad(5), math.rad(-4), 0.2)
  1040. SetAngle(2, 0, Player.Character)
  1041. RemoveParts(Player.Character, 2)
  1042. CreateParts(Player.Character, 1)
  1043. ResetLimbCFrame(1, Player.Character)
  1044. ResetLimbCFrame(2, Player.Character)
  1045. EnableLimb(1, Player.Character)
  1046. EnableLimb(2, Player.Character)
  1047. CameraSlide(math.rad(6), math.rad(-15), 0.15)
  1048. CanUse = true
  1049. end
  1050.  
  1051.  
  1052. if script.Parent.ClassName ~= "HopperBin" then
  1053. if Player == nil then print("Error: Player not found!") return end
  1054. Tool = Instance.new("HopperBin")
  1055. Tool.Name = ModelName
  1056. Tool.Parent = Player.Backpack
  1057. Instance.new("IntValue", script).Name = "Magazine"
  1058. script.Name = "Main"
  1059. script.Parent = Tool
  1060. elseif script.Parent.ClassName == "HopperBin" and Connected == false then
  1061. Connected = true
  1062. Player = script.Parent.Parent.Parent
  1063. if Player.Backpack:FindFirstChild("Ammo") == nil then
  1064. Instance.new("Configuration", Player.Backpack).Name = "Ammo"
  1065. end
  1066. if Player.Backpack.Ammo:FindFirstChild(AmmoType) == nil then
  1067. Instance.new("IntValue", Player.Backpack.Ammo).Name = AmmoType
  1068. Player.Backpack.Ammo[AmmoType].Value = 10 * 4
  1069. end
  1070. script.Parent.Selected:connect(onSelected)
  1071. script.Parent.Deselected:connect(onDeselected)
  1072. CreateParts(Player.Character, 1)
  1073. coroutine.wrap(loadstring(FirstPerson))()
  1074. coroutine.wrap(loadstring(MouseAim))()
  1075. coroutine.wrap(loadstring(ScopeZoom))()
  1076. coroutine.wrap(loadstring(AmmoCounter))()
  1077. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement