Advertisement
Guest User

Laser Knife

a guest
Feb 21st, 2020
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local PERKY = "Quick Hands"
  2. local ABIL = "Laser Knife"
  3.  
  4. local Player = game.Players.LocalPlayer
  5. Player.Backpack:FindFirstChild("Client").Disabled = true
  6. local IS = game:GetService("UserInputService")
  7. local Camera = workspace.CurrentCamera
  8. local KT = Instance.new("Tool", Player.Backpack)
  9. KT.Name = "Knife"
  10. KT.RequiresHandle = false
  11. KT.CanBeDropped = false
  12. local Spec = 0
  13. local WeaponType
  14. local Spectatable = {}
  15. local SpectatingPlayer
  16. local FPS = false
  17. local PlayerIgnore = workspace:WaitForChild("Ignore"):WaitForChild("Players")
  18. local runService = game:GetService("RunService")
  19. local RS = game:GetService("RunService").RenderStepped
  20. local Char = Player.Character
  21. local Rig = Instance.new("Model", Char)
  22. local Humanoid = Char:WaitForChild("Humanoid")
  23. local Primed = false
  24. if 0 >= Humanoid.Health then
  25. return
  26. end
  27. local Mouse = Player:GetMouse()
  28. Mouse.TargetFilter = workspace.CurrentCamera
  29. local Disabled = false
  30. if Camera:findFirstChild("FpsModel") then
  31. Camera:findFirstChild("FpsModel"):Destroy()
  32. end
  33. local LA, RA, Head, T = Char:WaitForChild("Left Arm"), Char:WaitForChild("Right Arm"), Char:WaitForChild("Head"), Char:WaitForChild("Torso")
  34. local FpsModel = Instance.new("Model", Camera)
  35. FpsModel.Name = "FpsModel"
  36. local FpsWeapon = Instance.new("Part")
  37. FpsWeapon.Parent = FpsModel
  38. FpsWeapon.CanCollide = false
  39. FpsWeapon.Transparency = 1
  40. FpsWeapon.Size = Vector3.new(1, 1, 1)
  41. FpsWeapon.Name = "WeaponFPS"
  42. local FpsLArm = Char:WaitForChild("Left Arm"):clone()
  43. FpsLArm.Parent = FpsModel
  44. FpsLArm.CanCollide = false
  45. FpsLArm.Transparency = 1
  46. local m = Instance.new("BlockMesh", FpsLArm)
  47. m.Scale = Vector3.new(1, 1, 1)
  48. local FpsRArm = Char:WaitForChild("Right Arm"):clone()
  49. FpsRArm.Parent = FpsModel
  50. FpsRArm.CanCollide = false
  51. FpsRArm.Transparency = 1
  52. local m = Instance.new("BlockMesh", FpsRArm)
  53. m.Scale = Vector3.new(1, 1.1, 1)
  54. spawn(function()
  55. wait(0.5)
  56. if Char:FindFirstChild("Body Colors") then
  57. FpsLArm.BrickColor = Char:FindFirstChild("Body Colors").LeftArmColor
  58. FpsRArm.BrickColor = Char:FindFirstChild("Body Colors").RightArmColor
  59. end
  60. end)
  61. local Modules = game.ReplicatedStorage:WaitForChild("Modules")
  62. local M = require(Modules:WaitForChild("AnimationCore"))
  63. local WC = require(Modules:WaitForChild("WeaponCore"))
  64. local AniDB = false
  65. local Selected = false
  66. function AniEquipKnife()
  67. if WeaponType == "Gun" or not Selected then
  68. return
  69. end
  70. M.Animate(Char:findFirstChild("MotorRight Arm", true), CFrame.new(-0.45, 0.5, -0.25) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(25)), 0.1, true)
  71. M.Animate(Char:findFirstChild("MotorWeapon", true), CFrame.new(0, -1, 1) * CFrame.Angles(math.rad(-180), math.rad(0), math.rad(0)), 0.25, true)
  72. wait(0.1)
  73. if WeaponType == "Gun" or not Selected then
  74. return
  75. end
  76. M.Animate(Char:findFirstChild("MotorRight Arm", true), CFrame.new(-0.5, 0.5, -0.25) * CFrame.Angles(math.rad(-75), math.rad(-25), math.rad(0)), 0.25, true)
  77. M.Animate(Char:findFirstChild("MotorLeft Arm", true), CFrame.new(0.5, 0.5, -0.25) * CFrame.Angles(math.rad(-55), math.rad(25), math.rad(0)), 0.25, true)
  78. M.Animate(Char:findFirstChild("MotorWeapon", true), CFrame.new(0, -1, 1) * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0)), 0.25, true)
  79. end
  80. function AniChargeKnife()
  81. if WeaponType == "Gun" or not Selected then
  82. return
  83. end
  84. M.Animate(Char:findFirstChild("MotorRight Arm", true), CFrame.new(-0.5, 0.5, -0.25) * CFrame.Angles(math.rad(-180), math.rad(0), math.rad(0)), .1, true)
  85. M.Animate(Char:findFirstChild("MotorLeft Arm", true), CFrame.new(0.5, 0.5, -0.25) * CFrame.Angles(math.rad(-90), math.rad(25), math.rad(0)), .1, true)
  86. M.Animate(Char:findFirstChild("MotorWeapon", true), CFrame.new(0, -1, 1) * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0)), .1, true)
  87. end
  88. function AniChargeKnife2()
  89. if WeaponType == "Gun" or not Selected then
  90. return
  91. end
  92. M.Animate(Char:findFirstChild("MotorRight Arm", true), CFrame.new(-0.5, 0.5, -0.25) * CFrame.Angles(math.rad(-180), math.rad(0), math.rad(0)), .1, true)
  93. M.Animate(Char:findFirstChild("MotorLeft Arm", true), CFrame.new(0.5, 0.5, -0.25) * CFrame.Angles(math.rad(-90), math.rad(25), math.rad(0)), .1, true)
  94. M.Animate(Char:findFirstChild("MotorWeapon", true), CFrame.new(0, -1, 1) * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0)), .1, true)
  95. end
  96. function AniThrowKnife()
  97. if WeaponType == "Gun" or not Selected then
  98. return
  99. end
  100. M.Animate(Char:findFirstChild("MotorRight Arm", true), CFrame.new(-0.5, 0.5, -0.25) * CFrame.Angles(math.rad(-10), math.rad(-25), math.rad(0)), 0.1, true)
  101. M.Animate(Char:findFirstChild("MotorLeft Arm", true), CFrame.new(0.5, 0.5, -0.25) * CFrame.Angles(math.rad(-35), math.rad(25), math.rad(0)), 0.1, true)
  102. M.Animate(Char:findFirstChild("MotorWeapon", true), CFrame.new(0, -1, 1) * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0)), 0.1, true)
  103. wait(0.1)
  104. M.Animate(Char:findFirstChild("MotorRight Arm", true), CFrame.new(-0.5, 0.5, -0.25) * CFrame.Angles(math.rad(25), math.rad(-25), math.rad(0)), 0.2, true)
  105. M.Animate(Char:findFirstChild("MotorLeft Arm", true), CFrame.new(0.5, 0.5, -0.25) * CFrame.Angles(math.rad(-35), math.rad(25), math.rad(0)), 0.2, true)
  106. M.Animate(Char:findFirstChild("MotorWeapon", true), CFrame.new(0, -1, 1) * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0)), 0.2, true)
  107. end
  108. function AniSlashKnife1()
  109. if WeaponType == "Gun" or not Selected then
  110. return
  111. end
  112. M.Animate(Char:findFirstChild("MotorRight Arm", true), CFrame.new(-0.5, 0.5, -0.25) * CFrame.Angles(math.rad(-125), math.rad(-30), math.rad(0)), 0.15, true)
  113. M.Animate(Char:findFirstChild("MotorLeft Arm", true), CFrame.new(0.5, 0.5, -0.25) * CFrame.Angles(math.rad(-65), math.rad(30), math.rad(0)), 0.15, true)
  114. M.Animate(Char:findFirstChild("MotorWeapon", true), CFrame.new(0, -1, 1) * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0)), 0.15, true)
  115. wait(0.15)
  116. if WeaponType == "Gun" or not Selected then
  117. return
  118. end
  119. M.Animate(Char:findFirstChild("MotorRight Arm", true), CFrame.new(-0.5, 1, -0.25) * CFrame.Angles(math.rad(-15), math.rad(-35), math.rad(0)), 0.05, true)
  120. M.Animate(Char:findFirstChild("MotorLeft Arm", true), CFrame.new(0.5, 0.5, -0.25) * CFrame.Angles(math.rad(-35), math.rad(35), math.rad(0)), 0.05, true)
  121. M.Animate(Char:findFirstChild("MotorWeapon", true), CFrame.new(0, -1, 1) * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0)), 0.05, true)
  122. wait(0.05)
  123. if WeaponType == "Gun" or not Selected then
  124. return
  125. end
  126. M.Animate(Char:findFirstChild("MotorRight Arm", true), CFrame.new(-0.5, 0.5, -0.25) * CFrame.Angles(math.rad(-75), math.rad(-25), math.rad(0)), 0.25, true)
  127. M.Animate(Char:findFirstChild("MotorLeft Arm", true), CFrame.new(0.5, 0.5, -0.25) * CFrame.Angles(math.rad(-55), math.rad(25), math.rad(0)), 0.25, true)
  128. M.Animate(Char:findFirstChild("MotorWeapon", true), CFrame.new(0, -1, 1) * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0)), 0.25, true)
  129. end
  130. function AniSlashKnife2()
  131. if WeaponType == "Gun" or not Selected then
  132. return
  133. end
  134. M.Animate(Char:findFirstChild("MotorRight Arm", true), CFrame.new(-0.5, 0.5, -0.25) * CFrame.Angles(math.rad(-175), math.rad(-10), math.rad(0)), 0.25, true)
  135. M.Animate(Char:findFirstChild("MotorLeft Arm", true), CFrame.new(0.5, 0.5, -0.25) * CFrame.Angles(math.rad(-65), math.rad(10), math.rad(0)), 0.25, true)
  136. M.Animate(Char:findFirstChild("MotorWeapon", true), CFrame.new(0, -1, 1) * CFrame.Angles(math.rad(110), math.rad(180), math.rad(0)), 0.25, true)
  137. wait(0.25)
  138. if WeaponType == "Gun" or not Selected then
  139. return
  140. end
  141. M.Animate(Char:findFirstChild("MotorRight Arm", true), CFrame.new(-0.5, 1, -0.25) * CFrame.Angles(math.rad(-35), math.rad(-35), math.rad(0)), 0.05, true)
  142. M.Animate(Char:findFirstChild("MotorLeft Arm", true), CFrame.new(0.5, 1, -0.25) * CFrame.Angles(math.rad(-35), math.rad(15), math.rad(0)), 0.05, true)
  143. M.Animate(Char:findFirstChild("MotorWeapon", true), CFrame.new(0, -1, 1) * CFrame.Angles(math.rad(110), math.rad(180), math.rad(0)), 0.05, true)
  144. wait(0.05)
  145. if WeaponType == "Gun" or not Selected then
  146. return
  147. end
  148. M.Animate(Char:findFirstChild("MotorRight Arm", true), CFrame.new(-0.5, 1, -0.25) * CFrame.Angles(math.rad(-55), math.rad(-35), math.rad(0)), 0.25, true)
  149. M.Animate(Char:findFirstChild("MotorLeft Arm", true), CFrame.new(0.5, 0.5, -0.25) * CFrame.Angles(math.rad(-55), math.rad(25), math.rad(0)), 0.25, true)
  150. M.Animate(Char:findFirstChild("MotorWeapon", true), CFrame.new(0, -1, 1) * CFrame.Angles(math.rad(110), math.rad(180), math.rad(0)), 0.25, true)
  151. wait(0.25)
  152. if WeaponType == "Gun" or not Selected then
  153. return
  154. end
  155. M.Animate(Char:findFirstChild("MotorRight Arm", true), CFrame.new(-0.5, 0.5, -0.25) * CFrame.Angles(math.rad(-75), math.rad(-25), math.rad(0)), 0.25, true)
  156. M.Animate(Char:findFirstChild("MotorWeapon", true), CFrame.new(0, -1, 1) * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0)), 0.25, true)
  157. end
  158. function AniSlashKnife3()
  159. if WeaponType == "Gun" or not Selected then
  160. return
  161. end
  162. M.Animate(Char:findFirstChild("MotorRight Arm", true), CFrame.new(-0.5, 0.5, -0.7) * CFrame.Angles(math.rad(45), math.rad(-30), math.rad(0)), 0.2, true)
  163. M.Animate(Char:findFirstChild("MotorLeft Arm", true), CFrame.new(0.5, 0.5, -0.25) * CFrame.Angles(math.rad(-35), math.rad(10), math.rad(0)), 0.2, true)
  164. M.Animate(Char:findFirstChild("MotorWeapon", true), CFrame.new(0, -1, 1) * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0)), 0.2, true)
  165. wait(0.2)
  166. if WeaponType == "Gun" or not Selected then
  167. return
  168. end
  169. M.Animate(Char:findFirstChild("MotorRight Arm", true), CFrame.new(-0.5, 1, -0.25) * CFrame.Angles(math.rad(-60), math.rad(-35), math.rad(0)), 0.05, true)
  170. M.Animate(Char:findFirstChild("MotorLeft Arm", true), CFrame.new(0.5, 0.5, -0.25) * CFrame.Angles(math.rad(-45), math.rad(35), math.rad(0)), 0.05, true)
  171. M.Animate(Char:findFirstChild("MotorWeapon", true), CFrame.new(0, -1.5, 1) * CFrame.Angles(math.rad(130), math.rad(0), math.rad(0)), 0.05, true)
  172. wait(0.05)
  173. if WeaponType == "Gun" or not Selected then
  174. return
  175. end
  176. M.Animate(Char:findFirstChild("MotorRight Arm", true), CFrame.new(-0.5, 1, -0.25) * CFrame.Angles(math.rad(-65), math.rad(-35), math.rad(0)), 0.25, true)
  177. M.Animate(Char:findFirstChild("MotorLeft Arm", true), CFrame.new(0.5, 0.5, -0.25) * CFrame.Angles(math.rad(-55), math.rad(25), math.rad(0)), 0.25, true)
  178. M.Animate(Char:findFirstChild("MotorWeapon", true), CFrame.new(0, -1.5, 1) * CFrame.Angles(math.rad(130), math.rad(0), math.rad(0)), 0.25, true)
  179. wait(0.25)
  180. if WeaponType == "Gun" or not Selected then
  181. return
  182. end
  183. M.Animate(Char:findFirstChild("MotorRight Arm", true), CFrame.new(-0.5, 0.5, -0.25) * CFrame.Angles(math.rad(-75), math.rad(-25), math.rad(0)), 0.25, true)
  184. M.Animate(Char:findFirstChild("MotorWeapon", true), CFrame.new(0, -1, 1) * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0)), 0.25, true)
  185. end
  186. function AniSlashKnife4()
  187. if WeaponType == "Gun" or not Selected then
  188. return
  189. end
  190. M.Animate(Char:findFirstChild("MotorRight Arm", true), CFrame.new(-0.5, 0.5, -0.25) * CFrame.Angles(math.rad(-125), math.rad(0), math.rad(0)), 0.15, true)
  191. M.Animate(Char:findFirstChild("MotorLeft Arm", true), CFrame.new(0.5, 0.5, -0.25) * CFrame.Angles(math.rad(-65), math.rad(0), math.rad(0)), 0.15, true)
  192. M.Animate(Char:findFirstChild("MotorWeapon", true), CFrame.new(0, -1, 1) * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0)), 0.15, true)
  193. wait(0.15)
  194. if WeaponType == "Gun" or not Selected then
  195. return
  196. end
  197. M.Animate(Char:findFirstChild("MotorRight Arm", true), CFrame.new(-0.5, 1, -0.25) * CFrame.Angles(math.rad(-15), math.rad(-45), math.rad(0)), 0.05, true)
  198. M.Animate(Char:findFirstChild("MotorLeft Arm", true), CFrame.new(0.5, 0.5, -0.25) * CFrame.Angles(math.rad(-35), math.rad(45), math.rad(0)), 0.05, true)
  199. M.Animate(Char:findFirstChild("MotorWeapon", true), CFrame.new(0, -1, 1) * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0)), 0.05, true)
  200. wait(0.05)
  201. if WeaponType == "Gun" or not Selected then
  202. return
  203. end
  204. M.Animate(Char:findFirstChild("MotorRight Arm", true), CFrame.new(-0.5, 0.5, -0.25) * CFrame.Angles(math.rad(-75), math.rad(-25), math.rad(0)), 0.25, true)
  205. M.Animate(Char:findFirstChild("MotorLeft Arm", true), CFrame.new(0.5, 0.5, -0.25) * CFrame.Angles(math.rad(-55), math.rad(25), math.rad(0)), 0.25, true)
  206. M.Animate(Char:findFirstChild("MotorWeapon", true), CFrame.new(0, -1, 1) * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0)), 0.25, true)
  207. end
  208. function AniEquipGun()
  209. if WeaponType == "Knife" or not Selected then
  210. return
  211. end
  212. M.Animate(Char:findFirstChild("MotorRight Arm", true), CFrame.new(-0.45, 0.5, -0.25) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(25)), 0.1, true)
  213. wait(0.1)
  214. if WeaponType == "Knife" or not Selected then
  215. return
  216. end
  217. M.Animate(Char:findFirstChild("MotorRight Arm", true), CFrame.new(-0.45, 0.5, -0.25) * CFrame.Angles(math.rad(-90), math.rad(-25), math.rad(0)), 0.25, true)
  218. M.Animate(Char:findFirstChild("MotorLeft Arm", true), CFrame.new(0.9, 1, -0.25) * CFrame.Angles(math.rad(-90), math.rad(75), math.rad(0)), 0.25, true)
  219. M.Animate(Char:findFirstChild("MotorWeapon", true), CFrame.new(0.5, -1.75, -0.35) * CFrame.Angles(math.rad(180), math.rad(0), math.rad(-25)), 0.25, true)
  220. end
  221. function AniShootGun()
  222. if WeaponType == "Knife" or not Selected then
  223. return
  224. end
  225. M.Animate(Char:findFirstChild("MotorRight Arm", true), CFrame.new(-0.45, 0.5, -0.25) * CFrame.Angles(math.rad(-120), math.rad(-25), math.rad(-8)), 0.06, true)
  226. M.Animate(Char:findFirstChild("MotorLeft Arm", true), CFrame.new(0.9, 1, -0.25) * CFrame.Angles(math.rad(-110), math.rad(78), math.rad(5)), 0.06, true)
  227. M.Animate(Char:findFirstChild("MotorWeapon", true), CFrame.new(0.5, -1.75, -0.35) * CFrame.Angles(math.rad(180), math.rad(0), math.rad(-25)), 0.06, true)
  228. wait(0.06)
  229. if WeaponType == "Knife" or not Selected then
  230. return
  231. end
  232. M.Animate(Char:findFirstChild("MotorRight Arm", true), CFrame.new(-0.45, 0.5, -0.25) * CFrame.Angles(math.rad(-90), math.rad(-25), math.rad(0)), 0.15, true)
  233. M.Animate(Char:findFirstChild("MotorLeft Arm", true), CFrame.new(0.9, 1, -0.25) * CFrame.Angles(math.rad(-90), math.rad(75), math.rad(0)), 0.15, true)
  234. M.Animate(Char:findFirstChild("MotorWeapon", true), CFrame.new(0.5, -1.75, -0.35) * CFrame.Angles(math.rad(180), math.rad(0), math.rad(-25)), 0.15, true)
  235. wait(0.15)
  236. if WeaponType == "Knife" or not Selected then
  237. return
  238. end
  239. end
  240. function AniReloadGun()
  241. if WeaponType == "Knife" or not Selected then
  242. return
  243. end
  244. M.Animate(Char:findFirstChild("MotorLeft Arm", true), CFrame.new(0.5, 0.5, -0.25) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(-25)), 0.55, true)
  245. wait(0.55)
  246. if WeaponType == "Knife" or not Selected then
  247. return
  248. end
  249. M.Animate(Char:findFirstChild("MotorRight Arm", true), CFrame.new(-0.45, 0.5, -0.25) * CFrame.Angles(math.rad(-90), math.rad(-25), math.rad(-15)), 0.4, true)
  250. M.Animate(Char:findFirstChild("MotorLeft Arm", true), CFrame.new(0.7, 1.5, -0.5) * CFrame.Angles(math.rad(-100), math.rad(55), math.rad(-25)), 0.4, true)
  251. M.Animate(Char:findFirstChild("MotorWeapon", true), CFrame.new(0.5, -1.75, -0.35) * CFrame.Angles(math.rad(180), math.rad(0), math.rad(-25)), 0.4, true)
  252. wait(0.4)
  253. if WeaponType == "Knife" or not Selected then
  254. return
  255. end
  256. M.Animate(Char:findFirstChild("MotorRight Arm", true), CFrame.new(-0.45, 0.5, -0.25) * CFrame.Angles(math.rad(-95), math.rad(-30), math.rad(20)), 0.35, true)
  257. M.Animate(Char:findFirstChild("MotorLeft Arm", true), CFrame.new(0.7, 1.5, -0.5) * CFrame.Angles(math.rad(-100), math.rad(60), math.rad(-25)), 0.35, true)
  258. M.Animate(Char:findFirstChild("MotorWeapon", true), CFrame.new(0.5, -1.75, -0.35) * CFrame.Angles(math.rad(180), math.rad(25), math.rad(-25)), 0.35, true)
  259. wait(0.35)
  260. if WeaponType == "Knife" or not Selected then
  261. return
  262. end
  263. M.Animate(Char:findFirstChild("MotorRight Arm", true), CFrame.new(-0.45, 0.5, -0.25) * CFrame.Angles(math.rad(-90), math.rad(-25), math.rad(0)), 0.25, true)
  264. M.Animate(Char:findFirstChild("MotorLeft Arm", true), CFrame.new(0.9, 1, -0.25) * CFrame.Angles(math.rad(-80), math.rad(75), math.rad(0)), 0.25, true)
  265. M.Animate(Char:findFirstChild("MotorWeapon", true), CFrame.new(0.5, -1.75, -0.35) * CFrame.Angles(math.rad(180), math.rad(0), math.rad(-25)), 0.25, true)
  266. wait(0.25)
  267. if WeaponType == "Knife" then
  268. return
  269. end
  270. M.Animate(Char:findFirstChild("MotorRight Arm", true), CFrame.new(-0.45, 0.5, -0.25) * CFrame.Angles(math.rad(-90), math.rad(-25), math.rad(0)), 0.5, true)
  271. M.Animate(Char:findFirstChild("MotorLeft Arm", true), CFrame.new(0.9, 1, -0.25) * CFrame.Angles(math.rad(-90), math.rad(75), math.rad(0)), 0.5, true)
  272. M.Animate(Char:findFirstChild("MotorWeapon", true), CFrame.new(0.5, -1.75, -0.35) * CFrame.Angles(math.rad(180), math.rad(0), math.rad(-25)), 0.5, true)
  273. end
  274. local FpsPart = Instance.new("Part")
  275. FpsPart.Transparency = 1
  276. FpsPart.Anchored = true
  277. FpsPart.Parent = FpsModel
  278. FpsPart.CanCollide = false
  279. FpsPart.FormFactor = "Custom"
  280. FpsPart.Size = Vector3.new(0.2, 0.2, 0.2)
  281. local FpsWeaponWeld = Instance.new("Motor")
  282. FpsWeaponWeld.Parent = FpsPart
  283. FpsWeaponWeld.Part1 = FpsWeapon
  284. FpsWeaponWeld.Part0 = FpsRArm
  285. FpsWeaponWeld.C1 = CFrame.new(0, 2, 1)
  286. FpsWeaponWeld.C0 = CFrame.new()
  287. local FpsLArmWeld = Instance.new("Motor")
  288. FpsLArmWeld.Parent = FpsLArm
  289. FpsLArmWeld.Part1 = FpsLArm
  290. FpsLArmWeld.Part0 = FpsPart
  291. FpsLArmWeld.C1 = CFrame.new(0.5, 0, 0)
  292. FpsLArmWeld.C0 = CFrame.new(-1, 0.75, 0)
  293. local FpsRArmWeld = Instance.new("Motor")
  294. FpsRArmWeld.Parent = FpsRArm
  295. FpsRArmWeld.Part1 = FpsRArm
  296. FpsRArmWeld.Part0 = FpsPart
  297. FpsRArmWeld.C1 = CFrame.new(-0.5, 0, 0)
  298. FpsRArmWeld.C0 = CFrame.new(1, 0.75, 0)
  299. local energy = 100
  300. local maxEnergy = 100
  301. local move_anim_speed = 5
  302. local last_p = Vector3.new()
  303. local move_amm = 0
  304. local walking = false
  305. local running = false
  306. local walkingStop = true
  307. local aniRun = false
  308. local aniLegs = false
  309. local idle = true
  310. local WalkSpeed = Humanoid.WalkSpeed
  311. Humanoid.WalkSpeed = WalkSpeed
  312. local DB = false
  313. local Charging = false
  314. local Speed = 0.35
  315. local shake_freq = 5
  316. local CanMelee = true
  317. local CanReload = true
  318. local Shooting = false
  319. local Aimed = false
  320. local Zoomed = false
  321. local RunSpeed = 20
  322. Camera.CameraType = "Custom"
  323. Camera.CameraSubject = Humanoid
  324. coroutine.resume(coroutine.create(function()
  325. while FpsModel ~= nil do
  326. local delta = wait()
  327. local cur_p = T.Position
  328. if (cur_p - last_p).magnitude >= 0.1 then
  329. move_amm = math.min(1, move_amm + delta * move_anim_speed)
  330. walking = true
  331. if running then
  332. if energy <= 0 then
  333. aniRun = false
  334. running = false
  335. shake_freq = 5
  336. Humanoid.WalkSpeed = WalkSpeed
  337. end
  338. elseif energy < maxEnergy then
  339. energy = energy + 0.2
  340. end
  341. else
  342. move_amm = math.max(0, move_amm - delta * move_anim_speed)
  343. walking = false
  344. if energy < maxEnergy then
  345. energy = energy + 0.2
  346. end
  347. end
  348. last_p = cur_p
  349. end
  350. end))
  351. local RightArmWeld, LeftArmWeld, WeaponWeld
  352. local Cloaked = false
  353. local UserInputService = game:GetService("UserInputService")
  354. local Mobile = UserInputService.TouchEnabled
  355. if UserInputService.KeyboardEnabled then
  356. Mobile = false
  357. end
  358. runService.RenderStepped:connect(function()
  359. local last_time = tick()
  360. local delta = tick() - last_time
  361. last_time = tick()
  362. local breathe_amp = 1.5
  363. local breathe_freq = 1
  364. local breathe = math.sin(math.rad(tick() * 90 * breathe_freq)) * breathe_amp
  365. local shake_amp = {0.075, 0.075}
  366. local arm_shake = CFrame.new(math.cos(math.rad(tick() * 90 * shake_freq)) * move_amm * shake_amp[1], math.abs(math.cos(math.rad(tick() * 90 * shake_freq)) * move_amm * shake_amp[2]), 0)
  367. if (Head.Position - Camera.CoordinateFrame.p).magnitude < 2.5 and Selected then
  368. if Cloaked then
  369. FpsLArm.Transparency = 0.5
  370. FpsRArm.Transparency = 0.5
  371. FpsWeapon.Transparency = 0.5
  372. else
  373. FpsLArm.Transparency = 0
  374. FpsRArm.Transparency = 0
  375. FpsWeapon.Transparency = 0
  376. end
  377. FPS = true
  378. else
  379. FpsLArm.Transparency = 1
  380. FpsRArm.Transparency = 1
  381. FpsWeapon.Transparency = 1
  382. FPS = false
  383. end
  384. if FpsModel ~= nil and Char ~= nil and 0 < Humanoid.Health then
  385. if WeaponType == "Gun" then
  386. FpsPart.CFrame = Camera.CoordinateFrame * CFrame.new(0.7, -2, -0.4) * CFrame.Angles(math.rad(0 + breathe / 2), math.rad(0), math.rad(0)) * arm_shake
  387. elseif WeaponType == "Knife" then
  388. FpsPart.CFrame = Camera.CoordinateFrame * CFrame.new(0, -1.6, -0.4) * CFrame.Angles(math.rad(0 + breathe / 2), math.rad(0), math.rad(0)) * arm_shake
  389. end
  390. if RightArmWeld ~= nil and LeftArmWeld ~= nil and WeaponWeld ~= nil then
  391. if WeaponType == "Gun" then
  392. FpsLArmWeld.C1 = LeftArmWeld.C1 * CFrame.new(0.15, 0.09, -0.43) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(-5))
  393. FpsRArmWeld.C1 = RightArmWeld.C1
  394. FpsWeaponWeld.C1 = WeaponWeld.C1 * CFrame.new(0.1, -0.2, 0.25)
  395. elseif WeaponType == "Knife" then
  396. FpsLArmWeld.C1 = LeftArmWeld.C1 * CFrame.new(0.15, 0.09, -0.43)
  397. FpsRArmWeld.C1 = RightArmWeld.C1 * CFrame.Angles(math.rad(0), math.rad(25), math.rad(0))
  398. FpsWeaponWeld.C1 = WeaponWeld.C1 * CFrame.new(0, 0.15, 0.25)
  399. end
  400. end
  401. end
  402. end)
  403. local debouncetime = 1
  404. local lastjump = time()
  405. local WeaponMesh
  406. local used = false
  407. local Perk = PERKY
  408. Humanoid.Changed:connect(function(prop)
  409. if Perk == "Kevlar" and (Humanoid.Health == 98 or Humanoid.Health == 1398) and not used then
  410. Player.PlayerGui.Sounds.KevlarHurt:Play()
  411. used = true
  412. end
  413. end)
  414. local GunSkin = "http://www.roblox.com/asset/?id=79401500"
  415. local KnifeSkin = "http://www.roblox.com/asset/?id=130252453"
  416. local Charged = false
  417. local MouseDown = false
  418. local DB2 = false
  419. local Ability = ABIL
  420. local Gamemode
  421. local CanCloak = true
  422. local Knife = false
  423. local Gun = false
  424. local ThrowGui = Player.PlayerGui.GUI.ThrowKnife
  425. local CloakGui = Player.PlayerGui.GUI.CloakGui
  426. local Crosshair = Player.PlayerGui.GUI.MobileCrosshair
  427. local Gui = Player.PlayerGui.GUI
  428. game.Players.LocalPlayer.Backpack.ChildAdded:connect(function(c)
  429. if c.Name == "Gun" and not Gun then
  430. spawn(function()
  431. Gamemode = game.ReplicatedStorage.RemoteFunction:InvokeServer("Gamemode")
  432. Perk = game.ReplicatedStorage.RemoteFunction:InvokeServer("Perk")
  433. end)
  434. local Skin = game.ReplicatedStorage.RemoteFunction:InvokeServer("Skin", "Gun")
  435. if Skin ~= nil then
  436. GunSkin = Skin
  437. end
  438. if game.Players.LocalPlayer.Backpack:findFirstChild("Gun") ~= nil then
  439. Gun = true
  440. if Mobile then
  441. else
  442. KT.Activated:connect(function()
  443. if Gamemode == "One In The Chamber" and Char.Bullet.Value == false then
  444. return
  445. end
  446. if not DB then
  447. DB = false
  448. WC.ShootGun(Char, Char, Mouse.Hit.p, FPS, FpsWeapon)
  449. AniShootGun()
  450. wait(0.21)
  451. AniReloadGun()
  452. if not Selected then
  453. wait()
  454. end
  455. wait(0.1)
  456. DB = false
  457. end
  458. end)
  459. end
  460. KT.Equipped:connect(function()
  461. Selected = true
  462. WeaponType = "Gun"
  463. Mouse.Icon = "http://www.roblox.com/asset/?id=117431027"
  464. WC.EquipGun(Char, Char, GunSkin)
  465. RightArmWeld = Char:WaitForChild("MotorRight Arm")
  466. LeftArmWeld = Char:WaitForChild("MotorLeft Arm")
  467. WeaponWeld = Char:WaitForChild("MotorWeapon")
  468. WeaponMesh = Char:WaitForChild("Weapon"):findFirstChild("Mesh"):clone()
  469. WeaponMesh.Parent = FpsWeapon
  470. AniEquipGun()
  471. end)
  472. KT.Unequipped:connect(function()
  473. Selected = false
  474. Mouse.Icon = "rbxasset://textures\\ArrowCursor.png"
  475. if WeaponMesh ~= nil then
  476. WeaponMesh:Destroy()
  477. end
  478. WeaponType = nil
  479. WC.Unequip(Char, Char)
  480. end)
  481. end
  482. elseif c.Name == "Knife" and not Knife then
  483. spawn(function()
  484. Ability = ABIL
  485. Perk = PERKY
  486. if Ability == nil then
  487. Ability = ABIL
  488. end
  489. Gamemode = game.ReplicatedStorage.RemoteFunction:InvokeServer("Gamemode")
  490. end)
  491. local Skin = game.ReplicatedStorage.RemoteFunction:InvokeServer("Skin", "Knife")
  492. if Skin ~= nil then
  493. KnifeSkin = Skin
  494. end
  495. if game.Players.LocalPlayer.Backpack:findFirstChild("Knife") ~= nil then
  496. Knife = true
  497. KT.Activated:connect(function()
  498. MouseDown = true
  499. spawn(function()
  500. if Cloaked then
  501. WC.UnCloak(Char, Char)
  502. Cloaked = false
  503. end
  504. end)
  505. if Gamemode == "Infected" or Gamemode == "One In The Chamber" then
  506. return
  507. end
  508. if not DB2 and not DB then
  509. DB2 = true
  510. spawn(function()
  511. wait(0.35)
  512. if MouseDown and not DB then
  513. DB2 = true
  514. if Perk ~= "Quick Hands" then
  515. AniChargeKnife()
  516. wait(.1)
  517. else
  518. AniChargeKnife2()
  519. wait(.1)
  520. end
  521. if MouseDown and not DB then
  522. Charged = true
  523. end
  524. wait(0.5)
  525. DB2 = false
  526. else
  527. DB2 = false
  528. end
  529. end)
  530. end
  531. end)
  532. KT.Deactivated:connect(function()
  533. MouseDown = false
  534. if Charged then
  535. DB = true
  536. DB2 = true
  537. Charged = false
  538. spawn(function()
  539.  
  540. WC.ThrowKnife(Char, Char, Mouse.Hit.p, Ability)
  541. end)
  542. AniThrowKnife()
  543. wait(0.3)
  544. AniEquipKnife()
  545. DB = false
  546. DB2 = false
  547. elseif not DB then
  548. DB = true
  549. do
  550. local Ran = math.random(1, 3)
  551. spawn(function()
  552. WC.StabKnife(Char, Char, Ran, Ability)
  553. end)
  554. if Ran == 1 then
  555. AniSlashKnife1()
  556. elseif Ran == 2 then
  557. AniSlashKnife2()
  558. elseif Ran == 3 then
  559. AniSlashKnife3()
  560. elseif Ran == 4 then
  561. AniSlashKnife4()
  562. end
  563. wait(0.25)
  564. DB = false
  565. end
  566. end
  567. end)
  568. KT.Equipped:connect(function()
  569. Selected = true
  570. WeaponType = "Knife"
  571. Mouse.Icon = "http://www.roblox.com/asset/?id=117431027"
  572. WC.EquipKnife(Char, Char, KnifeSkin)
  573. RightArmWeld = Char:WaitForChild("MotorRight Arm")
  574. LeftArmWeld = Char:WaitForChild("MotorLeft Arm")
  575. WeaponWeld = Char:WaitForChild("MotorWeapon")
  576. WeaponMesh = Char:WaitForChild("Weapon"):findFirstChild("Mesh"):clone()
  577. WeaponMesh.Parent = FpsWeapon
  578. AniEquipKnife()
  579. if Char then
  580. if workspace.GameInProgress.Mode.Value ~= "Infected" then
  581. Char.Humanoid.WalkSpeed = 20
  582. if workspace.GameInProgress.Mode.Value == "Cold Killer" then
  583. Char.Humanoid.WalkSpeed = 20
  584. elseif Perk == "Speedy Gonzales" then
  585. Char.Humanoid.WalkSpeed = 25
  586. else
  587. Char.Humanoid.WalkSpeed = 20
  588. end
  589. else
  590. Char.Humanoid.WalkSpeed = 13
  591. end
  592. end
  593. end)
  594. KT.Unequipped:connect(function()
  595. if Mobile then
  596. ThrowGui.Visible = false
  597. if Perk == "Shadow Cloak" then
  598. CloakGui.Visible = false
  599. end
  600. end
  601. Charged = false
  602. MouseDown = false
  603. Selected = false
  604. Mouse.Icon = "rbxasset://textures\\ArrowCursor.png"
  605. if WeaponMesh ~= nil then
  606. WeaponMesh:Destroy()
  607. end
  608. WeaponType = nil
  609. WC.Unequip(Char, Char)
  610. if workspace.GameInProgress.Mode.Value ~= "Infected" then
  611. Char.Humanoid.WalkSpeed = 16
  612. else
  613. Char.Humanoid.WalkSpeed = 13
  614. end
  615. if Cloaked then
  616. WC.UnCloak(Char, Char)
  617. Cloaked = false
  618. end
  619. end)
  620. end
  621. end
  622. end)
  623. local DB3 = false
  624. IS.InputBegan:connect(function(input, chatting)
  625. if input.UserInputType == Enum.UserInputType.Gamepad1 and input.UserInputState == Enum.UserInputState.Begin and not chatting and Selected and input.KeyCode == Enum.KeyCode.ButtonX and WeaponType == "Knife" and CanCloak and Perk == "Shadow Cloak" then
  626. if Gamemode == "Infected" or Gamemode == "One In The Chamber" then
  627. return
  628. end
  629. CanCloak = false
  630. WC.Cloak(Char, Char)
  631. Cloaked = true
  632. wait(10)
  633. if Cloaked then
  634. WC.UnCloak(Char, Char)
  635. Cloaked = false
  636. end
  637. wait(15)
  638. CanCloak = true
  639. end
  640. if input.UserInputType == Enum.UserInputType.Keyboard and input.UserInputState == Enum.UserInputState.Begin and not chatting and Selected then
  641. if input.KeyCode == Enum.KeyCode.E and WeaponType == "Knife" and not DB3 then
  642. if Gamemode == "Infected" or Gamemode == "One In The Chamber" then
  643. return
  644. end
  645. DB3 = true
  646. spawn(function()
  647. if Cloaked then
  648. WC.UnCloak(Char, Char)
  649. Cloaked = false
  650. end
  651. end)
  652. if not DB2 and not DB then
  653. DB2 = true
  654. if not DB then
  655. DB2 = true
  656. DB = true
  657. if Perk ~= "Quick Hands" then
  658. AniChargeKnife()
  659. wait(.1)
  660. else
  661. AniChargeKnife2()
  662. wait(.1)
  663. end
  664. if not Selected or WeaponType ~= "Knife" then
  665. DB2 = false
  666. DB = false
  667. return
  668. end
  669. spawn(function()
  670. WC.ThrowKnife(Char, Char, Mouse.Hit.p, Ability)
  671. end)
  672. AniThrowKnife()
  673. wait(0.3)
  674. AniEquipKnife()
  675. DB = false
  676. DB2 = false
  677. else
  678. DB2 = false
  679. end
  680. end
  681. wait(0.25)
  682. DB3 = false
  683. elseif input.KeyCode == Enum.KeyCode.Q and WeaponType == "Knife" and CanCloak and Perk == "Shadow Cloak" then
  684. if Gamemode == "Infected" or Gamemode == "One In The Chamber" then
  685. return
  686. end
  687. CanCloak = false
  688. WC.Cloak(Char, Char)
  689. Cloaked = true
  690. wait(10)
  691. if Cloaked then
  692. WC.UnCloak(Char, Char)
  693. Cloaked = false
  694. end
  695. wait(15)
  696. CanCloak = true
  697. end
  698. end
  699. end)
  700. game.Players.ChildAdded:connect(function(c)
  701. wait(3)
  702. repeat
  703. wait()
  704. until not DB and not DB2 and not MouseDown
  705. if WeaponType == "Gun" then
  706. WC.EquipGun(Char, Char, GunSkin)
  707. AniEquipGun()
  708. elseif WeaponType == "Knife" then
  709. WC.EquipKnife(Char, Char, KnifeSkin)
  710. AniEquipKnife()
  711. end
  712. end)
  713. local Modules = game.ReplicatedStorage:WaitForChild("Modules")
  714. local M = require(Modules:WaitForChild("AnimationCore"))
  715. local WC = require(Modules:WaitForChild("WeaponCore"))
  716. local Mouse = game.Players.LocalPlayer:GetMouse()
  717. local Char = game.Players.LocalPlayer.Character
  718. Mouse.Button1Down:Connect(function()
  719. WC.ThrowKnife(Char, Char, Mouse.Hit.p, "Laser Knife")
  720. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement