Advertisement
IAmAGuestLol

Laser Knife (Textured + Fixed)

Apr 25th, 2017
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.63 KB | None | 0 0
  1. --Knife Module Script
  2. --Perhapz
  3. wait(.2)
  4.  
  5. local thing = Instance.new("Tool",game.Players.LocalPlayer.Backpack)
  6. thing.Name = "Laser Knife"
  7. local handl3 = Instance.new("Part",thing)
  8. handl3.Name = "Handle"
  9. local sund = Instance.new("Sound",handl3)
  10. sund.Name = "Sound"
  11.  
  12. script.Parent = thing
  13. local meshh = Instance.new("SpecialMesh",handl3)
  14. meshh.MeshId = "http://www.roblox.com/asset/?id=121944778"
  15. meshh.TextureId = "http://www.roblox.com/asset/?id=177974585"
  16.  
  17.  
  18. local tool=script.Parent
  19. local player=game.Players.LocalPlayer
  20. local char=player.Character
  21. local humanoid=char:FindFirstChild("Humanoid")
  22. local camera=workspace.CurrentCamera
  23. local rightC1 = CFrame.new(-0.5, 0.7, 0) * CFrame.Angles(0, (math.pi / 2), 0)
  24. local leftC1 = CFrame.new(0, 0.7, 0) * CFrame.Angles(0, (math.pi / 2), 0)
  25. local mouse=player:GetMouse()
  26. local equipping=false
  27. local gettingknife=false
  28. local laserCharge=false
  29. local playcharge=false
  30. local justthrown=false
  31. local canLaser=false
  32. local justattacked=false
  33. local thrownkniferotation=0
  34. local Damage=110
  35. local Attacking=false
  36. local handle=nil
  37. local WalkSpeeds={16,20}
  38. local fasterthrow = 2
  39. local knifespeed = 225
  40.  
  41.  
  42.  
  43. --[[if player.Gamepass4.Value == true then
  44. fasterthrow = 0.5
  45. else
  46. fasterthrow = 0.2
  47. end
  48. if player.Gamepass5.Value == true then
  49. knifespeed = 305
  50. else
  51. knifespeed = 225
  52. end
  53.  
  54. --]]
  55.  
  56. SOUNDS={
  57. throwing={"153647554"},
  58. laserthrowing={"167775098"},
  59. shouts={"170037553","141679994","170038933","138097458","246561524"},
  60. striking={"153647529","153647534","153647539","153647540"},
  61. equip="153647514",
  62. wallhit={"153647564"},
  63. hitplayer={"146594640","146457047","146594648"},
  64. deaths={""},
  65. }
  66.  
  67. SETTINGS={
  68.  
  69. tool={
  70. tool_size=Vector3.new(0.4, 3, 0.7),
  71. tool_transparency=0,
  72. tool_color=BrickColor.Black(),
  73. default_tool_size=0.6,
  74. },
  75.  
  76. }
  77.  
  78. function DamageObject(hit)
  79. local char=hit.Parent
  80. if char and char~=player.Character and char.Name~="Arms_Model" and hit.Name~="Handle" then
  81. local h=char:FindFirstChild("Humanoid")
  82. if h and h.Health > 0 then
  83.  
  84. h:TakeDamage(Damage)
  85. PlaySound("Hit1")
  86. if h.Health == 0 then
  87. PlaySound("Hit2")
  88. end
  89. end
  90. end
  91. end
  92.  
  93. function PlaySound(name,ctorso)
  94. if name=="Throw" then
  95. tool.Handle.Sound.SoundId = "rbxassetid://" .. SOUNDS.throwing[math.random(1,#SOUNDS.throwing)]
  96. tool.Handle.Sound:Play()
  97. elseif name=="ThrowLaser" then
  98. tool.Handle.Sound.SoundId = "rbxassetid://" .. SOUNDS.laserthrowing[math.random(1,#SOUNDS.laserthrowing)]
  99. tool.Handle.Sound:Play()
  100. elseif name=="Equip" then
  101. tool.Handle.Sound.SoundId = "rbxassetid://" .. SOUNDS.equip
  102. tool.Handle.Sound:Play()
  103. elseif name=="Swing" then
  104. tool.Handle.Sound.SoundId = "rbxassetid://" .. SOUNDS.striking[math.random(1,#SOUNDS.striking)]
  105. tool.Handle.Sound:Play()
  106. elseif name=="Hit1" then
  107. local NewSound=tool.Handle.Sound:clone()
  108. NewSound.Parent=ctorso
  109. NewSound.SoundId = "rbxassetid://" .. SOUNDS.hitplayer[math.random(1,#SOUNDS.hitplayer)]
  110. NewSound:Play()
  111. NewSound:Destroy()
  112. --elseif name=="Hit2" then
  113. --local NewSound=tool.Handle.Sound:clone()
  114. --NewSound.Parent=ctorso
  115. --NewSound.SoundId = "rbxassetid://" .. SOUNDS.deaths[math.random(1,#SOUNDS.deaths)]
  116. --NewSound:Play()
  117. -- NewSound:Destroy()
  118. elseif name=="Laser" then
  119. local NewSound=tool.Handle.Sound
  120. NewSound.SoundId = "rbxassetid://" .. SOUNDS.shouts[math.random(1,#SOUNDS.shouts)]
  121. NewSound:Play()
  122.  
  123. end
  124. end
  125.  
  126. function Throwtool(dPos)
  127. if not tool.Handle then return end
  128. local throwingHandle = tool.Handle:Clone()
  129. game:GetService("Debris"):AddItem(throwingHandle, 5)
  130. throwingHandle.Transparency=0
  131. throwingHandle.Parent = workspace
  132. if player.Character and player.Character.Humanoid then
  133. throwingHandle.Velocity = (player.Character.Humanoid.TargetPoint - throwingHandle.CFrame.p).unit * knifespeed
  134. if canLaser then
  135. throwingHandle.Velocity = (player.Character.Humanoid.TargetPoint - throwingHandle.CFrame.p).unit * 15000
  136. end
  137. if mouse.Target ~= nil then
  138. if mouse.Target.Parent.Name~="Arms_Model" and mouse.Target.Name~="ThrownKnife" and mouse.Target.Name~="Handle" then
  139. targetpos=player.Character.Humanoid.TargetPoint
  140. else
  141. targetpos=Vector3.new(0,-10,0)
  142. end
  143. end
  144. -- set the orientation to the direction it is being thrown in
  145. throwingHandle.CFrame = CFrame.new(throwingHandle.CFrame.p, throwingHandle.CFrame.p + throwingHandle.Velocity) * CFrame.Angles(0, 0, math.rad(-90))
  146. local floatingForce = Instance.new('BodyForce', throwingHandle)
  147. floatingForce.force = Vector3.new(0, 196.2 * throwingHandle:GetMass() * 0.98, 0)
  148. local spin = Instance.new('BodyAngularVelocity', throwingHandle)
  149. spin.angularvelocity = throwingHandle.CFrame:vectorToWorldSpace(Vector3.new(0, -400, 0))
  150. spawnPos=player.Character.PrimaryPart.Position
  151. spawnPos = spawnPos + dPos*5
  152. if canLaser then
  153. local Ray = Ray.new(tool.Handle.CFrame.p,(mouse.Hit.p - tool.Handle.CFrame.p).unit * 999)
  154. local Hit,Position = game.Workspace:FindPartOnRay(Ray,char)
  155. if Hit then
  156. if Hit.Parent:FindFirstChild("Humanoid") then
  157. throwingHandle:Destroy()
  158. Hit.Parent.Humanoid:TakeDamage(110)
  159. laserCharge=true
  160. end end
  161. local RayPart = Instance.new("Part",workspace)
  162. RayPart.Name = "RayPart"
  163. RayPart.BrickColor = BrickColor.new("Really red")
  164. RayPart.Transparency = 0
  165. RayPart.Anchored = true
  166. RayPart.CanCollide = false
  167. RayPart.TopSurface = Enum.SurfaceType.Smooth
  168. RayPart.BottomSurface = Enum.SurfaceType.Smooth
  169. RayPart.formFactor = Enum.FormFactor.Custom
  170. local Distance = (Position-tool.Handle.CFrame.p).magnitude
  171. RayPart.Size = Vector3.new(0.2,0.2,Distance)
  172. RayPart.CFrame = CFrame.new(Position,tool.Handle.CFrame.p) * CFrame.new(0,0,-Distance/2)
  173. game.Debris:addItem(RayPart,.5)
  174. PlaySound("Laser")
  175. for v=1, 10 do
  176. RayPart.Transparency = 0.1 * v
  177. wait()
  178. end
  179.  
  180. end
  181. end
  182. if throwingHandle then
  183.  
  184. local touchedConn = throwingHandle.Touched:connect(function(hit)
  185. local char=hit.Parent
  186. camera.CameraSubject=humanoid
  187. camera.CameraType=Enum.CameraType.Custom
  188. if char and char~=player.Character and char.Name~="Arms_Model" and hit.Name~="Handle" and hit.Name~="RayPart" then
  189. local h=char:FindFirstChild("Humanoid")
  190. if h and h.Health > 0 then
  191. throwingHandle:Destroy()
  192. laserCharge=true
  193. if hit.Name~="Head" or hit.className=="Hat" then
  194. h:TakeDamage(Damage)
  195. -- player.Credits.Value = player.Credits.Value + 15
  196. --player.PlayerGui.NormalKillGui.Script.Disabled = false
  197.  
  198. if h.Health == 0 then
  199. PlaySound("Hit2",char.Torso)
  200. end
  201. else
  202. h:TakeDamage(Damage * 2)
  203. print("Headshot!")
  204. --player.Credits.Value = player.Credits.Value + 50
  205. --player.PlayerGui.HeadShotGui.Script.Disabled = false
  206. char.Head.Transparency=1
  207. char.Head.CanCollide=false
  208. if char.Head:FindFirstChild("face") then char.Head:FindFirstChild("face").Transparency=1 end
  209. for _,v in pairs(char:GetChildren()) do
  210. if v.className=="Hat" then
  211. v:Destroy()
  212. end
  213. end
  214. for i = 1, 7 do
  215. local blood=Instance.new("Part")
  216. blood.FormFactor="Custom"
  217. blood.Size=Vector3.new(1,.2,1)
  218. blood.BrickColor=BrickColor.Red()
  219. blood.TopSurface=0
  220. blood.BottomSurface=0
  221. game:GetService("Debris"):AddItem(blood,5)
  222. blood.Parent=workspace
  223. blood.Position=char.Head.Position + Vector3.new(math.random(0.2,0.8),0,math.random(0.2,0.8))
  224. end
  225. local sound = Instance.new("Sound")
  226. sound.SoundId = "rbxassetid://142347633"
  227. sound.Parent=char.Head
  228. sound.Pitch=1.1
  229. sound:Play()
  230. end
  231. PlaySound("Hit1")
  232. if h.Health == 0 then
  233. PlaySound("Hit2")
  234. end
  235. elseif hit.Name~="Handle" or hit.Name~="IgnoreThrowingKnives" and hit.Parent.Name~="Arms_Model" and hit.Name~="RayPart" and hit.CanCollide==true then
  236. local sound=Instance.new("Sound")
  237. sound.Parent=hit
  238. sound.SoundId = "rbxassetid://" .. SOUNDS.wallhit[math.random(1,#SOUNDS.wallhit)]
  239. sound:Play()
  240. sound:Destroy()
  241. print("Hit Object: " .. hit.Name)
  242. local newknife=tool.Handle:clone()
  243. newknife.Name="ThrownKnife"
  244. newknife.CFrame = CFrame.new(spawnPos, spawnPos + dPos) * CFrame.Angles(math.pi/-2, 0, 0)
  245. newknife.Position = targetpos
  246. throwingHandle:Destroy()
  247. newknife.Anchored=true
  248. newknife.CanCollide=true
  249. newknife.Transparency=0
  250. newknife.Parent=workspace
  251. --newknife.Script.Disabled = false
  252. wait(7)
  253. for i=1,10 do
  254. newknife.Transparency=i*.1
  255. wait()
  256. end
  257. newknife:Destroy()
  258. end
  259. end
  260. end)
  261. end
  262. end
  263. -- must check if it still exists since we waited
  264. if throwingHandle then
  265. throwingHandle.CanCollide = true
  266. end
  267.  
  268. FUNCTIONS={
  269.  
  270. CHECKFORFIRSTPERSON=function()
  271. if (camera.focus.p - camera.CoordinateFrame.p).magnitude > 1 then
  272. return false
  273. else
  274. return true
  275. end
  276. end,
  277.  
  278. ANIMS=function(state)
  279. if state then
  280. mouse.Icon="http://www.roblox.com/asset/?id=139669907"
  281. --Start Animation
  282.  
  283. if SETTINGS.tool then
  284. tool.GripPos = Vector3.new(0, -0.55, 0)
  285. elseif SETTINGS.tool then
  286. tool.GripPos = Vector3.new(0, -0.6, 0)
  287. elseif SETTINGS.tool then
  288. tool.GripPos = Vector3.new(0, -0.65, 0)
  289. elseif SETTINGS.tool then
  290. tool.GripPos = Vector3.new(0, -0.7, 0)
  291. elseif SETTINGS.tool then
  292. tool.GripPos = Vector3.new(0, -0.75, 0)
  293. elseif SETTINGS.tool then
  294. tool.GripPos = Vector3.new(0, -0.8, 0)
  295. elseif SETTINGS.tool then
  296. tool.GripPos = Vector3.new(0, -0.85, 0)
  297. elseif SETTINGS.tool then
  298. tool.GripPos = Vector3.new(0, -0.9, 0)
  299. elseif SETTINGS.tool then
  300. tool.GripPos = Vector3.new(0, -0.95, 0)
  301. elseif SETTINGS.tool then
  302. tool.GripPos = Vector3.new(0, -1, 0)
  303. else
  304. print("Invalid tool size! Set to default: " .. SETTINGS.tool.default_tool_size )
  305.  
  306. if SETTINGS.tool.default_tool_size==.1 then
  307. tool.GripPos = Vector3.new(0, -0.55, 0)
  308. elseif SETTINGS.tool.default_tool_size==.2 then
  309. tool.GripPos = Vector3.new(0, -0.6, 0)
  310. elseif SETTINGS.tool.default_tool_size==.3 then
  311. tool.GripPos = Vector3.new(0, -0.65, 0)
  312. elseif SETTINGS.tool.default_tool_size==.4 then
  313. tool.GripPos = Vector3.new(0, -0.7, 0)
  314. elseif SETTINGS.tool.default_tool_size==.5 then
  315. tool.GripPos = Vector3.new(0, -0.75, 0)
  316. elseif SETTINGS.tool.default_tool_size==.6 then
  317. tool.GripPos = Vector3.new(0, -0.8, 0)
  318. elseif SETTINGS.tool.default_tool_size==.7 then
  319. tool.GripPos = Vector3.new(0, -0.85, 0)
  320. elseif SETTINGS.tool.default_tool_size==.8 then
  321. tool.GripPos = Vector3.new(0, -0.9, 0)
  322. elseif SETTINGS.tool.default_tool_size==.9 then
  323. tool.GripPos = Vector3.new(0, -0.95, 0)
  324. elseif SETTINGS.tool.default_tool_size==1 then
  325. tool.GripPos = Vector3.new(0, -1, 0)
  326. else
  327. print("Invalid default size! Un-equipping and removing Knife...")
  328.  
  329. end
  330. end
  331. torso=char:FindFirstChild("Torso")
  332. leftarm=torso:FindFirstChild("Left Shoulder")
  333. if leftarm then
  334. leftarm.Parent=nil
  335. newarmweld=Instance.new("Weld")
  336. newarmweld.Name="LeftWeld"
  337. newarmweld.Part0=torso
  338. newarmweld.C0 = CFrame.new(-1.5, 0.7, 0)
  339. newarmweld.C1 = CFrame.new(0, 0.7, 0)
  340. newarmweld.Part1=char:FindFirstChild("Left Arm")
  341. newarmweld.Parent=torso
  342. end
  343. humanoid.WalkSpeed=WalkSpeeds[2]
  344. for i = 1, 15, 3 do
  345. if equipped then
  346. torso:FindFirstChild("Right Shoulder").C1 = rightC1 * CFrame.Angles((-i * (math.pi / 90)),(-i * (math.pi / 90)),(i * (math.pi / 210)))
  347. torso:FindFirstChild("LeftWeld").C1 = CFrame.new(-0.2, .7, 0) * CFrame.Angles((-i * (math.pi / 60)),(i * (math.pi / 90)),(-i * (math.pi / 240)))
  348. end
  349. wait()
  350. end
  351. else
  352. humanoid.WalkSpeed=WalkSpeeds[1]
  353. torso:FindFirstChild("Right Shoulder").C1 = rightC1 * CFrame.new(0,-0.2,0)
  354. tool.GripForward = Vector3.new(0,0,-1)
  355. newarmweld:Destroy()
  356. leftarm.Parent=torso
  357. mouse.Icon=""
  358. torso:FindFirstChild("Neck").C0 = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  359. torso:FindFirstChild("Right Shoulder").C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  360. end
  361. end
  362. }
  363.  
  364. tool.Equipped:connect(function ()
  365. equipped=true
  366. PlaySound("Equip")
  367. FUNCTIONS.ANIMS(true)
  368. end)
  369. tool.Unequipped:connect(function ()
  370. equipped=false
  371. FUNCTIONS.ANIMS(false)
  372. end)
  373. tool.Handle.Touched:connect(function (hit)
  374. if Attacking then
  375. DamageObject(hit)
  376. end
  377. end)
  378. tool.Activated:connect(function ()
  379. if Attacking then return end
  380. if not tool.Enabled then return end
  381. justthrown=false
  382. justattacked=false
  383. if not gettingknife and not justthrown and not Attacking then
  384. HeldTime=time()
  385. end
  386. playcharge=true
  387. wait(.15)
  388. while gettingknife do
  389. wait()
  390. end
  391. local speed=0.2
  392. for i = 1, 15, fasterthrow do
  393. if playcharge and equipped and not gettingknife and not justthrown and not Attacking then
  394. torso:FindFirstChild("Right Shoulder").C1 = CFrame.new(-0.5, 0.5, 0, 0.195277825, -0.747909963, 0.634426773, 0.482016951, 0.636551082, 0.602048457, -0.854123056, 0.188237742, 0.484809577) * CFrame.Angles((i * (math.pi / 50)), 0, (-i * (math.pi / 25)))
  395. torso:FindFirstChild("LeftWeld").C1 = CFrame.new(-0.2, .7, 0, 0.858912528, 0.165011853, 0.484809607, -0.464581847, 0.649385393, 0.602048457, -0.215483144, -0.742340684, 0.634426773) * CFrame.Angles((-i * (math.pi / 75)),(i * (math.pi / 180)),0)
  396. player.Character["Right Arm"].RightGrip.C1 = CFrame.new(0, -0.800000012, 0.05, 1, 0, 0, 0, 1, 0, 0, 0, 1) * CFrame.Angles((-i * (math.pi / 150)),0,0)
  397. wait()
  398. end
  399. end
  400. if playcharge then
  401. canLaser=true
  402. end
  403. end)
  404. tool.Deactivated:connect(function ()
  405. if not tool.Enabled then return end
  406. currTime=time()
  407. playcharge=false
  408. if HeldTime and currTime - HeldTime > 0.2 and
  409. currTime - HeldTime > 0.01 and not justthrown and not gettingknife then
  410. if not Attacking and not justattacked then
  411. print("Throw")
  412. if canLaser then
  413. PlaySound("ThrowLaser")
  414. else
  415. PlaySound("Throw")
  416. end
  417. tool.Handle.Transparency=1
  418. local targetPos = player.Character.Humanoid.TargetPoint
  419. local lookAt = (targetPos - player.Character.PrimaryPart.Position).unit
  420. local switchEvenOddParity = 1
  421. local angle = math.ceil((1-1)/2)*math.pi/12*switchEvenOddParity
  422. Throwtool(CFrame.Angles(0, angle, 0) * lookAt)
  423. wait()
  424. canLaser=false
  425. HeldTime=0
  426. gettingknife=true
  427. mouse.Icon="http://www.roblox.com/asset/?id=139669907"
  428. player.Character["Right Arm"].RightGrip.C1 = CFrame.new(0, -0.800000012, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  429. for i = 1, 15, .8 do
  430. if equipped then
  431. torso:FindFirstChild("Right Shoulder").C1 = CFrame.new(-0.5, 0.5, 0, 0.0719629526, 0.22870943, 0.970831275, -0.981789052, 0.187819958, 0.0285283029, -0.175816804, -0.955204487, 0.238060504) * CFrame.Angles(0, 0, (i * (math.pi / 15)))
  432. torso:FindFirstChild("LeftWeld").C1 = CFrame.new(-0.2, 0.7, 0, 0.703028679, -0.151466534, 0.694844246, -0.673604906, 0.171488613, 0.718921423, -0.228050426, -0.973472893, 0.0185328126) * CFrame.Angles((i * (math.pi / 60)),(-i * (math.pi / 180)),(i * (math.pi / 60)))
  433. wait()
  434. end
  435. end
  436. justthrown=true
  437. tool.Handle.Transparency=0
  438. PlaySound("Equip")
  439. mouse.Icon="http://www.roblox.com/asset/?id=139669907"
  440. tool.GripForward = Vector3.new(0,0,-1)
  441. for i = 1, 15, 1 do
  442. if equipped then
  443. torso:FindFirstChild("Right Shoulder").C1 = CFrame.new(-0.5, 0.5, 0, -0.071962975, -0.22870943, 0.970831275, 0.981789052, -0.187820047, 0.0285283029, 0.175816894, 0.955204487, 0.238060504) * CFrame.Angles(0, 0, (-i * (math.pi / 30)))
  444. wait()
  445. end
  446. end
  447. gettingknife=false
  448. for i = 1, 15, 3 do
  449. if equipped then
  450. torso:FindFirstChild("Right Shoulder").C1 = rightC1 * CFrame.Angles((-i * (math.pi / 90)),(-i * (math.pi / 90)),(i * (math.pi / 210)))
  451. torso:FindFirstChild("LeftWeld").C1 = CFrame.new(-0.2, .7, 0) * CFrame.Angles((-i * (math.pi / 60)),(i * (math.pi / 90)),(-i * (math.pi / 240)))
  452. end
  453. wait()
  454. end
  455. end
  456. else
  457. if not justthrown and not gettingknife then
  458. if Attacking then return end
  459. print("Attack")
  460. HeldTime=0
  461. Attacking=true
  462. justattacked=true
  463. if math.random(1,2)==1 then
  464. for i = 1, 15, 3 do
  465. if equipped and not gettingknife and not justthrown then
  466. torso:FindFirstChild("Right Shoulder").C1 = CFrame.new(-0.5, 0.5, 0, 0.195277825, -0.747909963, 0.634426773, 0.482016951, 0.636551082, 0.602048457, -0.854123056, 0.188237742, 0.484809577) * CFrame.Angles((i * (math.pi / 65)), 0, (-i * (math.pi / 30)))
  467. torso:FindFirstChild("LeftWeld").C1 = CFrame.new(-0.2, .7, 0, 0.858912528, 0.165011853, 0.484809607, -0.464581847, 0.649385393, 0.602048457, -0.215483144, -0.742340684, 0.634426773) * CFrame.Angles((-i * (math.pi / 75)),(i * (math.pi / 180)),0)
  468. wait()
  469. end
  470. end
  471. PlaySound("Swing")
  472. for i = 1, 15, 3 do
  473. if equipped and not gettingknife and not justthrown then
  474. torso:FindFirstChild("Right Shoulder").C1 = CFrame.new(-0.5, 0.5, 0, 0.0719629526, 0.22870943, 0.970831275, -0.981789052, 0.187819958, 0.0285283029, -0.175816804, -0.955204487, 0.238060504) * CFrame.Angles(0, 0, (i * (math.pi / 15)))
  475. torso:FindFirstChild("LeftWeld").C1 = CFrame.new(-0.2, 0.7, 0, 0.703028679, -0.151466534, 0.694844246, -0.673604906, 0.171488613, 0.718921423, -0.228050426, -0.973472893, 0.0185328126) * CFrame.Angles((i * (math.pi / 60)),(-i * (math.pi / 180)),(i * (math.pi / 60)))
  476. wait()
  477. end
  478. end
  479. for i = 1, 15, 3 do
  480. if equipped and not justthrown and not gettingknife then
  481. torso:FindFirstChild("Right Shoulder").C1 = CFrame.new(-0.5, 0.5, 0, -0.071962975, -0.22870943, 0.970831275, 0.981789052, -0.187820047, 0.0285283029, 0.175816894, 0.955204487, 0.238060504) * CFrame.Angles(0, 0, (-i * (math.pi / 30)))
  482. wait()
  483. end
  484. end
  485. for i = 1, 15, 3 do
  486. equipping=true
  487. if equipped and not gettingknife and not justthrown then
  488. torso:FindFirstChild("Right Shoulder").C1 = rightC1 * CFrame.Angles((-i * (math.pi / 90)),(-i * (math.pi / 90)),(i * (math.pi / 210)))
  489. torso:FindFirstChild("LeftWeld").C1 = CFrame.new(-0.2, .7, 0) * CFrame.Angles((-i * (math.pi / 60)),(i * (math.pi / 90)),(-i * (math.pi / 240)))
  490. end
  491. wait()
  492. end
  493. Attacking=false
  494. else
  495. for i = 1, 15, 3 do
  496. if equipped and not gettingknife and not justthrown then
  497. torso:FindFirstChild("Right Shoulder").C1 = CFrame.new(-0.3, 0.5, 0, 0.195277825, -0.747909963, 0.634426773, 0.482016951, 0.636551082, 0.602048457, -0.854123056, 0.188237742, 0.484809577) * CFrame.Angles((i * (math.pi / 40)),(-i * (math.pi / 45)),(i * (math.pi / 60)))
  498. end
  499. wait()
  500. end
  501. PlaySound("Swing")
  502. for i = 1, 15, 3 do
  503. if equipped and not gettingknife and not justthrown then
  504. torso:FindFirstChild("Right Shoulder").C1 = CFrame.new(-0.2, 0.5, -.3, 0.852928281, -0.428775758, 0.29776603, 0.516928136, 0.614185035, -0.596290231, 0.0727913082, 0.662516415, 0.745502114) * CFrame.Angles((-i * (math.pi / 45)),0,0)
  505. torso:FindFirstChild("LeftWeld").C1 = CFrame.new(-0.200000003, 0.7, 0, 0.849384904, 0.16895318, 0.5, -0.48470962, 0.624545038, 0.612372398, -0.208810255, -0.762494743, 0.612372398) * CFrame.Angles((i * (math.pi / 60)),(-i * (math.pi / 180)),(i * (math.pi / 60)))
  506. end
  507. wait()
  508. end
  509. for i = 1, 15, 3 do
  510. if equipped and not gettingknife and not justthrown then
  511. torso:FindFirstChild("Right Shoulder").C1 = CFrame.new(-0.3, 0.5, -0.300000012, 0.852928281, -0.472260833, -0.222447708, 0.516928136, 0.82349503, 0.233754784, 0.0727913082, -0.314365625, 0.946507096) * CFrame.Angles((i * (math.pi / 45)),0,0)
  512. end
  513. wait()
  514. end
  515. for i = 1, 15, 3 do
  516. if equipped and not gettingknife and not justthrown then
  517. torso:FindFirstChild("Right Shoulder").C1 = rightC1 * CFrame.Angles((-i * (math.pi / 90)),(-i * (math.pi / 90)),(i * (math.pi / 210)))
  518. torso:FindFirstChild("LeftWeld").C1 = CFrame.new(-0.2, .7, 0) * CFrame.Angles((-i * (math.pi / 60)),(i * (math.pi / 90)),(-i * (math.pi / 240)))
  519. end
  520. wait()
  521. end
  522. Attacking=false
  523. end
  524. end
  525. end
  526. end)
  527.  
  528. mouse.Move:connect(function ()
  529. if equipped and mouse then
  530. if (mouse.Hit.p - mouse.Origin.p).unit.y < 0.25 and (mouse.Hit.p - mouse.Origin.p).unit.y > -0.25 then
  531. torso:FindFirstChild("Right Shoulder").C0 = CFrame.new(.9,.5,0) * CFrame.Angles(0,math.rad(90),0) * CFrame.Angles(0, 0, math.asin((mouse.Hit.p - mouse.Origin.p).unit.y))
  532. torso:FindFirstChild("LeftWeld").C0 = CFrame.new(-1.5,0.5,0) * CFrame.Angles(0, 0, math.asin((mouse.Hit.p - mouse.Origin.p).unit.y))
  533. torso:FindFirstChild("Neck").C0 = CFrame.new(0,1,0) * CFrame.Angles(math.rad(-90),0,math.rad(180)) * CFrame.Angles(math.asin(-(mouse.Hit.p - mouse.Origin.p).unit.y), 0, 0)
  534. end
  535. end
  536. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement