DarkScriptZEditors

Knaife

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