rblx345

Untitled

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