Advertisement
jericoalejo

Untitled

May 24th, 2017
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.01 KB | None | 0 0
  1. --Knife Module Script
  2.  
  3. --Perhapz
  4.  
  5. wait(.2)
  6. local toool = Instance.new("Tool",game.Players.LocalPlayer.Backpack)
  7. toool.Name = "ThrowingKnife"
  8.  
  9. local hndle = Instance.new("Part",toool)
  10. hndle.Name = "Handle"
  11.  
  12. local mesh = Instance.new("SpecialMesh",hndle)
  13. mesh.MeshId = "http://www.roblox.com/asset/?id=121944778"
  14. mesh.TextureId = "http://www.roblox.com/asset/?id=121944805"
  15. mesh.Scale = Vector3.new(.7,.7,.7)
  16.  
  17. local sound = Instance.new("Sound",hndle)
  18.  
  19.  
  20. script.Parent = toool
  21.  
  22.  
  23.  
  24.  
  25. local tool=script.Parent
  26.  
  27. local player=game.Players.LocalPlayer
  28.  
  29. local char=player.Character
  30.  
  31. local humanoid=char:FindFirstChild("Humanoid")
  32.  
  33. local camera=workspace.CurrentCamera
  34.  
  35. local rightC1 = CFrame.new(-0.5, 0.7, 0) * CFrame.Angles(0, (math.pi / 2), 0)
  36.  
  37. local leftC1 = CFrame.new(0, 0.7, 0) * CFrame.Angles(0, (math.pi / 2), 0)
  38.  
  39. local mouse=player:GetMouse()
  40.  
  41. local equipping=false
  42.  
  43. local gettingknife=false
  44.  
  45. local laserCharge=false
  46.  
  47. local playcharge=false
  48.  
  49. local justthrown=false
  50.  
  51. local canLaser=true
  52.  
  53. local justattacked=false
  54.  
  55. local thrownkniferotation=0
  56.  
  57. local Damage=9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999.999999999999999999999999999999999999999999999999999999999999999999
  58.  
  59. local Attacking=false
  60.  
  61. local handle=nil
  62.  
  63. local WalkSpeeds={16,20}
  64.  
  65. local fasterthrow = .2
  66.  
  67. local knifespeed = 225
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75. --[[if player.Gamepass4.Value == true then
  76.  
  77. fasterthrow = 0.5
  78.  
  79. else
  80.  
  81. fasterthrow = 0.2
  82.  
  83. end
  84.  
  85. if player.Gamepass5.Value == true then
  86.  
  87. knifespeed = 305
  88.  
  89. else
  90.  
  91. knifespeed = 225
  92.  
  93. end
  94. --]]
  95.  
  96.  
  97.  
  98.  
  99.  
  100. SOUNDS={
  101.  
  102. throwing={"153647554","153647549"},
  103.  
  104. laserthrowing={"193444173"},
  105.  
  106. shouts={"241084057","224360245","199837759","168209314"},
  107.  
  108. striking={"153647529","153647534","153647539","153647540"},
  109.  
  110. equip="153647514",
  111.  
  112. wallhit={"153647563","153647564"},
  113.  
  114. hitplayer={"153676325"},
  115.  
  116. deaths={"146457047","146594648"},
  117.  
  118. }
  119.  
  120.  
  121.  
  122. SETTINGS={
  123.  
  124.  
  125. tool={
  126.  
  127. tool_size=Vector3.new(0.4, 3, 0.7),
  128.  
  129. tool_transparency=0,
  130.  
  131. tool_color=BrickColor.Black(),
  132.  
  133. default_tool_size=0.6,
  134.  
  135. },
  136.  
  137.  
  138. }
  139.  
  140.  
  141.  
  142. function DamageObject(hit)
  143.  
  144. local char=hit.Parent
  145.  
  146. if char and char~=player.Character and char.Name~="Arms_Model" and hit.Name~="Handle" then
  147.  
  148. local h=char:FindFirstChild("Humanoid")
  149.  
  150. if h and h.Health > 0 then
  151.  
  152.  
  153.  
  154. h:TakeDamage(Damage)
  155.  
  156. PlaySound("Hit1",char.Torso)
  157.  
  158. if h.Health == 0 then
  159.  
  160. PlaySound("Hit2")
  161.  
  162. end
  163.  
  164. end
  165.  
  166. end
  167.  
  168. end
  169.  
  170.  
  171.  
  172. function PlaySound(name,ctorso)
  173.  
  174. if name=="Throw" then
  175.  
  176. tool.Handle.Sound.SoundId = "rbxassetid://" .. SOUNDS.throwing[math.random(1,#SOUNDS.throwing)]
  177.  
  178. tool.Handle.Sound:Play()
  179.  
  180. elseif name=="ThrowLaser" then
  181.  
  182. tool.Handle.Sound.SoundId = "rbxassetid://" .. SOUNDS.laserthrowing[math.random(1,#SOUNDS.laserthrowing)]
  183.  
  184. tool.Handle.Sound:Play()
  185.  
  186. elseif name=="Equip" then
  187.  
  188. tool.Handle.Sound.SoundId = "rbxassetid://" .. SOUNDS.equip
  189.  
  190. tool.Handle.Sound:Play()
  191.  
  192. elseif name=="Swing" then
  193.  
  194. tool.Handle.Sound.SoundId = "rbxassetid://" .. SOUNDS.striking[math.random(1,#SOUNDS.striking)]
  195.  
  196. tool.Handle.Sound:Play()
  197.  
  198. elseif name=="Hit1" then
  199.  
  200. local NewSound=tool.Handle.Sound:clone()
  201.  
  202. NewSound.Parent=ctorso
  203.  
  204. NewSound.SoundId = "rbxassetid://" .. SOUNDS.hitplayer[math.random(1,#SOUNDS.hitplayer)]
  205.  
  206. NewSound:Play()
  207.  
  208. NewSound:Destroy()
  209.  
  210. --elseif name=="Hit2" then
  211.  
  212. --local NewSound=tool.Handle.Sound:clone()
  213.  
  214. --NewSound.Parent=ctorso
  215.  
  216. --NewSound.SoundId = "rbxassetid://" .. SOUNDS.deaths[math.random(1,#SOUNDS.deaths)]
  217.  
  218. --NewSound:Play()
  219.  
  220. -- NewSound:Destroy()
  221.  
  222. elseif name=="Laser" then
  223.  
  224. local NewSound=tool.Handle.Sound:Clone()
  225.  
  226. NewSound.Parent = ctorso
  227. NewSound.SoundId = "rbxassetid://" .. SOUNDS.shouts[math.random(1,#SOUNDS.shouts)]
  228.  
  229. NewSound:Play()
  230.  
  231.  
  232. end
  233.  
  234. end
  235.  
  236.  
  237.  
  238. function Throwtool(dPos)
  239.  
  240. if not tool.Handle then return end
  241.  
  242. local throwingHandle = tool.Handle:Clone()
  243.  
  244. game:GetService("Debris"):AddItem(throwingHandle, 5)
  245.  
  246. throwingHandle.Transparency=0
  247.  
  248. throwingHandle.Parent = workspace
  249.  
  250. if player.Character and player.Character.Humanoid then
  251.  
  252. throwingHandle.Velocity = (player.Character.Humanoid.TargetPoint - throwingHandle.CFrame.p).unit * knifespeed
  253.  
  254. if canLaser then
  255.  
  256. throwingHandle.Velocity = (player.Character.Humanoid.TargetPoint - throwingHandle.CFrame.p).unit * 15000
  257.  
  258. end
  259.  
  260. if mouse.Target ~= nil then
  261.  
  262. if mouse.Target.Parent.Name~="Arms_Model" and mouse.Target.Name~="ThrownKnife" and mouse.Target.Name~="Handle" then
  263.  
  264. targetpos=player.Character.Humanoid.TargetPoint
  265.  
  266. else
  267.  
  268. targetpos=Vector3.new(0,-10,0)
  269.  
  270. end
  271.  
  272. end
  273.  
  274. -- set the orientation to the direction it is being thrown in
  275.  
  276. throwingHandle.CFrame = CFrame.new(throwingHandle.CFrame.p, throwingHandle.CFrame.p + throwingHandle.Velocity) * CFrame.Angles(0, 0, math.rad(-90))
  277.  
  278. local floatingForce = Instance.new('BodyForce', throwingHandle)
  279.  
  280. floatingForce.force = Vector3.new(0, 196.2 * throwingHandle:GetMass() * 0.98, 0)
  281.  
  282. local spin = Instance.new('BodyAngularVelocity', throwingHandle)
  283.  
  284. spin.angularvelocity = throwingHandle.CFrame:vectorToWorldSpace(Vector3.new(0, -400, 0))
  285.  
  286. spawnPos=player.Character.PrimaryPart.Position
  287.  
  288. spawnPos = spawnPos + dPos*5
  289.  
  290. if canLaser then
  291.  
  292. local Ray = Ray.new(tool.Handle.CFrame.p,(mouse.Hit.p - tool.Handle.CFrame.p).unit * 999)
  293.  
  294. local Hit,Position = game.Workspace:FindPartOnRay(Ray,char)
  295.  
  296. if Hit then
  297.  
  298. if Hit.Parent:FindFirstChild("Humanoid") then
  299.  
  300. throwingHandle:Destroy()
  301.  
  302. Hit.Parent.Humanoid:TakeDamage(110)
  303. PlaySound("Laser",Hit.Parent.Torso)
  304. PlaySound("Hit1",Hit.Parent.Torso)
  305. laserCharge=true
  306.  
  307. end end
  308.  
  309. local RayPart = Instance.new("Part",workspace)
  310.  
  311. RayPart.Name = "RayPart"
  312.  
  313. RayPart.BrickColor = BrickColor.new("White")
  314.  
  315. RayPart.Transparency = 0
  316.  
  317. RayPart.Anchored = true
  318.  
  319. RayPart.CanCollide = false
  320.  
  321. RayPart.TopSurface = Enum.SurfaceType.Smooth
  322.  
  323. RayPart.BottomSurface = Enum.SurfaceType.Smooth
  324.  
  325. RayPart.formFactor = Enum.FormFactor.Custom
  326.  
  327. local Distance = (Position-tool.Handle.CFrame.p).magnitude
  328.  
  329. RayPart.Size = Vector3.new(0.2,0.2,Distance)
  330.  
  331. RayPart.CFrame = CFrame.new(Position,tool.Handle.CFrame.p) * CFrame.new(0,0,-Distance/2)
  332.  
  333. game.Debris:addItem(RayPart,.5)
  334.  
  335.  
  336. end
  337.  
  338. end
  339.  
  340. if throwingHandle then
  341.  
  342.  
  343.  
  344. local touchedConn = throwingHandle.Touched:connect(function(hit)
  345.  
  346. local char=hit.Parent
  347.  
  348. camera.CameraSubject=humanoid
  349.  
  350. camera.CameraType=Enum.CameraType.Custom
  351.  
  352. if char and char~=player.Character and char.Name~="Arms_Model" and hit.Name~="Handle" and hit.Name~="RayPart" then
  353.  
  354. local h=char:FindFirstChild("Humanoid")
  355.  
  356. if h and h.Health > 0 then
  357.  
  358. throwingHandle:Destroy()
  359.  
  360. laserCharge=true
  361.  
  362. if hit.Name~="Head" or hit.className=="Hat" then
  363.  
  364. h:TakeDamage(Damage)
  365.  
  366. -- player.Credits.Value = player.Credits.Value + 15
  367.  
  368. --player.PlayerGui.NormalKillGui.Script.Disabled = false
  369.  
  370. if h.Health == 0 then
  371.  
  372. PlaySound("Hit2",char.Torso)
  373.  
  374. end
  375.  
  376. else
  377.  
  378. h:TakeDamage(Damage * 2)
  379.  
  380. print("Headshot!")
  381.  
  382. --player.Credits.Value = player.Credits.Value + 50
  383.  
  384. --player.PlayerGui.HeadShotGui.Script.Disabled = false
  385.  
  386. char.Head.Transparency=1
  387.  
  388. char.Head.CanCollide=false
  389.  
  390. if char.Head:FindFirstChild("face") then char.Head:FindFirstChild("face").Transparency=1 end
  391.  
  392. for _,v in pairs(char:GetChildren()) do
  393.  
  394. if v.className=="Hat" then
  395.  
  396. v:Destroy()
  397.  
  398. end
  399.  
  400. end
  401.  
  402. for i = 1, 7 do
  403.  
  404. local blood=Instance.new("Part")
  405.  
  406. blood.FormFactor="Custom"
  407.  
  408. blood.Size=Vector3.new(1,.2,1)
  409.  
  410. blood.BrickColor=BrickColor.Red()
  411.  
  412. blood.TopSurface=0
  413.  
  414. blood.BottomSurface=0
  415.  
  416. game:GetService("Debris"):AddItem(blood,5)
  417.  
  418. blood.Parent=workspace
  419.  
  420. blood.Position=char.Head.Position + Vector3.new(math.random(0.2,0.8),0,math.random(0.2,0.8))
  421.  
  422. end
  423.  
  424. local sound = Instance.new("Sound")
  425.  
  426. sound.SoundId = "rbxassetid://142347633"
  427.  
  428. sound.Parent=char.Head
  429.  
  430. sound.Pitch=1.1
  431.  
  432. sound:Play()
  433.  
  434. end
  435.  
  436. PlaySound("Hit1",char.Torso)
  437.  
  438. if h.Health == 0 then
  439.  
  440. PlaySound("Hit2")
  441.  
  442. end
  443.  
  444. elseif hit.Name~="Handle" or hit.Name~="IgnoreThrowingKnives" and hit.Parent.Name~="Arms_Model" and hit.Name~="RayPart" and hit.CanCollide==true then
  445.  
  446. local sound=Instance.new("Sound")
  447.  
  448. sound.Parent=hit
  449.  
  450. sound.SoundId = "rbxassetid://" .. SOUNDS.wallhit[math.random(1,#SOUNDS.wallhit)]
  451.  
  452. sound:Play()
  453.  
  454. sound:Destroy()
  455.  
  456. print("Hit Object: " .. hit.Name)
  457.  
  458. local newknife=tool.Handle:clone()
  459.  
  460. newknife.Name="ThrownKnife"
  461.  
  462. newknife.CFrame = CFrame.new(spawnPos, spawnPos + dPos) * CFrame.Angles(math.pi/-2, 0, 0)
  463.  
  464. newknife.Position = targetpos
  465.  
  466. throwingHandle:Destroy()
  467.  
  468. newknife.Anchored=true
  469.  
  470. newknife.CanCollide=true
  471.  
  472. newknife.Transparency=0
  473.  
  474. newknife.Parent=workspace
  475.  
  476. --newknife.Script.Disabled = false
  477.  
  478. wait(7)
  479.  
  480. for i=1,10 do
  481.  
  482. newknife.Transparency=i*.1
  483.  
  484. wait()
  485.  
  486. end
  487.  
  488. newknife:Destroy()
  489.  
  490. end
  491.  
  492. end
  493.  
  494. end)
  495.  
  496. end
  497.  
  498. end
  499.  
  500. -- must check if it still exists since we waited
  501.  
  502. if throwingHandle then
  503.  
  504. throwingHandle.CanCollide = true
  505.  
  506. end
  507.  
  508.  
  509.  
  510. FUNCTIONS={
  511.  
  512.  
  513. CHECKFORFIRSTPERSON=function()
  514.  
  515. if (camera.focus.p - camera.CoordinateFrame.p).magnitude > 1 then
  516.  
  517. return false
  518.  
  519. else
  520.  
  521. return true
  522.  
  523. end
  524.  
  525. end,
  526.  
  527.  
  528. ANIMS=function(state)
  529.  
  530. if state then
  531.  
  532. mouse.Icon="http://www.roblox.com/asset/?id=258828417"
  533.  
  534. --Start Animation
  535.  
  536.  
  537.  
  538. if SETTINGS.tool then
  539.  
  540. tool.GripPos = Vector3.new(0, -0.55, 0)
  541.  
  542. elseif SETTINGS.tool then
  543.  
  544. tool.GripPos = Vector3.new(0, -0.6, 0)
  545.  
  546. elseif SETTINGS.tool then
  547.  
  548. tool.GripPos = Vector3.new(0, -0.65, 0)
  549.  
  550. elseif SETTINGS.tool then
  551.  
  552. tool.GripPos = Vector3.new(0, -0.7, 0)
  553.  
  554. elseif SETTINGS.tool then
  555.  
  556. tool.GripPos = Vector3.new(0, -0.75, 0)
  557.  
  558. elseif SETTINGS.tool then
  559.  
  560. tool.GripPos = Vector3.new(0, -0.8, 0)
  561.  
  562. elseif SETTINGS.tool then
  563.  
  564. tool.GripPos = Vector3.new(0, -0.85, 0)
  565.  
  566. elseif SETTINGS.tool then
  567.  
  568. tool.GripPos = Vector3.new(0, -0.9, 0)
  569.  
  570. elseif SETTINGS.tool then
  571.  
  572. tool.GripPos = Vector3.new(0, -0.95, 0)
  573.  
  574. elseif SETTINGS.tool then
  575.  
  576. tool.GripPos = Vector3.new(0, -1, 0)
  577.  
  578. else
  579.  
  580. print("Invalid tool size! Set to default: " .. SETTINGS.tool.default_tool_size )
  581.  
  582.  
  583. if SETTINGS.tool.default_tool_size==.1 then
  584.  
  585. tool.GripPos = Vector3.new(0, -0.55, 0)
  586.  
  587. elseif SETTINGS.tool.default_tool_size==.2 then
  588.  
  589. tool.GripPos = Vector3.new(0, -0.6, 0)
  590.  
  591. elseif SETTINGS.tool.default_tool_size==.3 then
  592.  
  593. tool.GripPos = Vector3.new(0, -0.65, 0)
  594.  
  595. elseif SETTINGS.tool.default_tool_size==.4 then
  596.  
  597. tool.GripPos = Vector3.new(0, -0.7, 0)
  598.  
  599. elseif SETTINGS.tool.default_tool_size==.5 then
  600.  
  601. tool.GripPos = Vector3.new(0, -0.75, 0)
  602.  
  603. elseif SETTINGS.tool.default_tool_size==.6 then
  604.  
  605. tool.GripPos = Vector3.new(0, -0.8, 0)
  606.  
  607. elseif SETTINGS.tool.default_tool_size==.7 then
  608.  
  609. tool.GripPos = Vector3.new(0, -0.85, 0)
  610.  
  611. elseif SETTINGS.tool.default_tool_size==.8 then
  612.  
  613. tool.GripPos = Vector3.new(0, -0.9, 0)
  614.  
  615. elseif SETTINGS.tool.default_tool_size==.9 then
  616.  
  617. tool.GripPos = Vector3.new(0, -0.95, 0)
  618.  
  619. elseif SETTINGS.tool.default_tool_size==1 then
  620.  
  621. tool.GripPos = Vector3.new(0, -1, 0)
  622.  
  623. else
  624.  
  625. print("Invalid default size! Un-equipping and removing Knife...")
  626.  
  627.  
  628. end
  629.  
  630. end
  631.  
  632. torso=char:FindFirstChild("Torso")
  633.  
  634. leftarm=torso:FindFirstChild("Left Shoulder")
  635.  
  636. if leftarm then
  637.  
  638. leftarm.Parent=nil
  639.  
  640. newarmweld=Instance.new("Weld")
  641.  
  642. newarmweld.Name="LeftWeld"
  643.  
  644. newarmweld.Part0=torso
  645.  
  646. newarmweld.C0 = CFrame.new(-1.5, 0.7, 0)
  647.  
  648. newarmweld.C1 = CFrame.new(0, 0.7, 0)
  649.  
  650. newarmweld.Part1=char:FindFirstChild("Left Arm")
  651.  
  652. newarmweld.Parent=torso
  653.  
  654. end
  655.  
  656. humanoid.WalkSpeed=WalkSpeeds[2]
  657.  
  658. for i = 1, 15, 3 do
  659.  
  660. if equipped then
  661.  
  662. torso:FindFirstChild("Right Shoulder").C1 = rightC1 * CFrame.Angles((-i * (math.pi / 90)),(-i * (math.pi / 90)),(i * (math.pi / 210)))
  663.  
  664. torso:FindFirstChild("LeftWeld").C1 = CFrame.new(-0.2, .7, 0) * CFrame.Angles((-i * (math.pi / 60)),(i * (math.pi / 90)),(-i * (math.pi / 240)))
  665.  
  666. end
  667.  
  668. wait()
  669.  
  670. end
  671.  
  672. else
  673.  
  674. humanoid.WalkSpeed=WalkSpeeds[1]
  675.  
  676. torso:FindFirstChild("Right Shoulder").C1 = rightC1 * CFrame.new(0,-0.2,0)
  677.  
  678. tool.GripForward = Vector3.new(0,0,-1)
  679.  
  680. newarmweld:Destroy()
  681.  
  682. leftarm.Parent=torso
  683.  
  684. mouse.Icon=""
  685.  
  686. torso:FindFirstChild("Neck").C0 = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  687.  
  688. torso:FindFirstChild("Right Shoulder").C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  689.  
  690. end
  691.  
  692. end
  693.  
  694. }
  695.  
  696.  
  697.  
  698. tool.Equipped:connect(function ()
  699.  
  700. equipped=true
  701.  
  702. PlaySound("Equip")
  703.  
  704. FUNCTIONS.ANIMS(true)
  705.  
  706. end)
  707.  
  708. tool.Unequipped:connect(function ()
  709.  
  710. equipped=false
  711.  
  712. FUNCTIONS.ANIMS(false)
  713.  
  714. end)
  715.  
  716. tool.Handle.Touched:connect(function (hit)
  717.  
  718. if Attacking then
  719.  
  720. DamageObject(hit)
  721.  
  722. end
  723.  
  724. end)
  725.  
  726. tool.Activated:connect(function ()
  727.  
  728. if Attacking then return end
  729.  
  730. if not tool.Enabled then return end
  731.  
  732. justthrown=false
  733.  
  734. justattacked=false
  735.  
  736. if not gettingknife and not justthrown and not Attacking then
  737.  
  738. HeldTime=time()
  739.  
  740. end
  741.  
  742. playcharge=true
  743.  
  744. wait(.15)
  745.  
  746. while gettingknife do
  747.  
  748. wait()
  749.  
  750. end
  751.  
  752. local speed=0.2
  753.  
  754. for i = 1, 15, fasterthrow do
  755.  
  756. if playcharge and equipped and not gettingknife and not justthrown and not Attacking then
  757.  
  758. 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)))
  759.  
  760. 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)
  761.  
  762. 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)
  763.  
  764. wait()
  765.  
  766. end
  767.  
  768. end
  769.  
  770. if playcharge then
  771.  
  772. canLaser=true
  773.  
  774. end
  775.  
  776. end)
  777.  
  778. tool.Deactivated:connect(function ()
  779.  
  780. if not tool.Enabled then return end
  781.  
  782. currTime=time()
  783.  
  784. playcharge=false
  785.  
  786. if HeldTime and currTime - HeldTime > .6 and
  787.  
  788. currTime - HeldTime > 0.01 and not justthrown and not gettingknife then
  789.  
  790. if not Attacking and not justattacked then
  791.  
  792. print("Throw")
  793.  
  794. if canLaser then
  795.  
  796. PlaySound("ThrowLaser")
  797.  
  798. else
  799.  
  800. PlaySound("Throw")
  801.  
  802. end
  803.  
  804. tool.Handle.Transparency=1
  805.  
  806. local targetPos = player.Character.Humanoid.TargetPoint
  807.  
  808. local lookAt = (targetPos - player.Character.PrimaryPart.Position).unit
  809.  
  810. local switchEvenOddParity = 1
  811.  
  812. local angle = math.ceil((1-1)/2)*math.pi/12*switchEvenOddParity
  813.  
  814. Throwtool(CFrame.Angles(0, angle, 0) * lookAt)
  815.  
  816. wait()
  817. canLaser=true
  818.  
  819. HeldTime=0
  820.  
  821. gettingknife=true
  822.  
  823. mouse.Icon="http://www.roblox.com/asset/?id=258828417"
  824.  
  825. player.Character["Right Arm"].RightGrip.C1 = CFrame.new(0, -0.800000012, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  826.  
  827. for i = 1, 15, .8 do
  828.  
  829. if equipped then
  830.  
  831. 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)))
  832.  
  833. 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)))
  834.  
  835. wait()
  836.  
  837. end
  838.  
  839. end
  840.  
  841. justthrown=true
  842.  
  843. tool.Handle.Transparency=0
  844.  
  845. PlaySound("Equip")
  846.  
  847. mouse.Icon="http://www.roblox.com/asset/?id=258828417"
  848.  
  849. tool.GripForward = Vector3.new(0,0,-1)
  850.  
  851. for i = 1, 15, 1 do
  852.  
  853. if equipped then
  854.  
  855. 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)))
  856.  
  857. wait()
  858.  
  859. end
  860.  
  861. end
  862.  
  863. gettingknife=false
  864.  
  865. for i = 1, 15, 3 do
  866.  
  867. if equipped then
  868.  
  869. torso:FindFirstChild("Right Shoulder").C1 = rightC1 * CFrame.Angles((-i * (math.pi / 90)),(-i * (math.pi / 90)),(i * (math.pi / 210)))
  870.  
  871. torso:FindFirstChild("LeftWeld").C1 = CFrame.new(-0.2, .7, 0) * CFrame.Angles((-i * (math.pi / 60)),(i * (math.pi / 90)),(-i * (math.pi / 240)))
  872.  
  873. end
  874.  
  875. wait()
  876.  
  877. end
  878.  
  879. end
  880.  
  881. else
  882.  
  883. if not justthrown and not gettingknife then
  884.  
  885. if Attacking then return end
  886.  
  887. print("Attack")
  888.  
  889. HeldTime=0
  890.  
  891. Attacking=true
  892.  
  893. justattacked=true
  894.  
  895. if math.random(1,2)==1 then
  896.  
  897. for i = 1, 15, 3 do
  898.  
  899. if equipped and not gettingknife and not justthrown then
  900.  
  901. 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)))
  902.  
  903. 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)
  904.  
  905. wait()
  906.  
  907. end
  908.  
  909. end
  910.  
  911. PlaySound("Swing")
  912.  
  913. for i = 1, 15, 3 do
  914.  
  915. if equipped and not gettingknife and not justthrown then
  916.  
  917. 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)))
  918.  
  919. 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)))
  920.  
  921. wait()
  922.  
  923. end
  924.  
  925. end
  926.  
  927. for i = 1, 15, 3 do
  928.  
  929. if equipped and not justthrown and not gettingknife then
  930.  
  931. 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)))
  932.  
  933. wait()
  934.  
  935. end
  936.  
  937. end
  938.  
  939. for i = 1, 15, 3 do
  940.  
  941. equipping=true
  942.  
  943. if equipped and not gettingknife and not justthrown then
  944.  
  945. torso:FindFirstChild("Right Shoulder").C1 = rightC1 * CFrame.Angles((-i * (math.pi / 90)),(-i * (math.pi / 90)),(i * (math.pi / 210)))
  946.  
  947. torso:FindFirstChild("LeftWeld").C1 = CFrame.new(-0.2, .7, 0) * CFrame.Angles((-i * (math.pi / 60)),(i * (math.pi / 90)),(-i * (math.pi / 240)))
  948.  
  949. end
  950.  
  951. wait()
  952.  
  953. end
  954.  
  955. Attacking=false
  956.  
  957. else
  958.  
  959. for i = 1, 15, 3 do
  960.  
  961. if equipped and not gettingknife and not justthrown then
  962.  
  963. 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)))
  964.  
  965. end
  966.  
  967. wait()
  968.  
  969. end
  970.  
  971. PlaySound("Swing")
  972.  
  973. for i = 1, 15, 3 do
  974.  
  975. if equipped and not gettingknife and not justthrown then
  976.  
  977. 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)
  978.  
  979. 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)))
  980.  
  981. end
  982.  
  983. wait()
  984.  
  985. end
  986.  
  987. for i = 1, 15, 3 do
  988.  
  989. if equipped and not gettingknife and not justthrown then
  990.  
  991. 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)
  992.  
  993. end
  994.  
  995. wait()
  996.  
  997. end
  998.  
  999. for i = 1, 15, 3 do
  1000.  
  1001. if equipped and not gettingknife and not justthrown then
  1002.  
  1003. torso:FindFirstChild("Right Shoulder").C1 = rightC1 * CFrame.Angles((-i * (math.pi / 90)),(-i * (math.pi / 90)),(i * (math.pi / 210)))
  1004.  
  1005. torso:FindFirstChild("LeftWeld").C1 = CFrame.new(-0.2, .7, 0) * CFrame.Angles((-i * (math.pi / 60)),(i * (math.pi / 90)),(-i * (math.pi / 240)))
  1006.  
  1007. end
  1008.  
  1009. wait()
  1010.  
  1011. end
  1012.  
  1013. Attacking=false
  1014.  
  1015. end
  1016.  
  1017. end
  1018.  
  1019. end
  1020.  
  1021. end)
  1022.  
  1023.  
  1024.  
  1025. mouse.Move:connect(function ()
  1026.  
  1027. if equipped and mouse then
  1028.  
  1029. if (mouse.Hit.p - mouse.Origin.p).unit.y < 0.25 and (mouse.Hit.p - mouse.Origin.p).unit.y > -0.25 then
  1030.  
  1031. 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))
  1032.  
  1033. 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))
  1034.  
  1035. 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)
  1036.  
  1037. end
  1038.  
  1039. end
  1040.  
  1041. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement