Advertisement
IAmAGuestLol

laser knife fix test

Dec 31st, 2023
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.62 KB | None | 0 0
  1. -- This script has been converted to FE by iPxter
  2.  
  3.  
  4. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  5. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  6. do
  7. print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
  8. script.Parent = Player.Character
  9.  
  10. --RemoteEvent for communicating
  11. local Event = Instance.new("RemoteEvent")
  12. Event.Name = "UserInput_Event"
  13.  
  14. --Fake event to make stuff like Mouse.KeyDown work
  15. local function fakeEvent()
  16. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  17. t.connect = t.Connect
  18. return t
  19. end
  20.  
  21. --Creating fake input objects with fake variables
  22. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  23. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  24. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  25. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  26. end}
  27. --Merged 2 functions into one by checking amount of arguments
  28. CAS.UnbindAction = CAS.BindAction
  29.  
  30. --This function will trigger the events that have been :Connect()'ed
  31. local function te(self,ev,...)
  32. local t = m[ev]
  33. if t and t._fakeEvent and t.Function then
  34. t.Function(...)
  35. end
  36. end
  37. m.TrigEvent = te
  38. UIS.TrigEvent = te
  39.  
  40. Event.OnServerEvent:Connect(function(plr,io)
  41. if plr~=Player then return end
  42. if io.isMouse then
  43. m.Target = io.Target
  44. m.Hit = io.Hit
  45. else
  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. for _,t in pairs(CAS.Actions) do
  51. for _,k in pairs(t.Keys) do
  52. if k==io.KeyCode then
  53. t.Function(t.Name,io.UserInputState,io)
  54. end
  55. end
  56. end
  57. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  58. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  59. end
  60. end)
  61. Event.Parent = NLS([==[
  62. local Player = game:GetService("Players").LocalPlayer
  63. local Event = script:WaitForChild("UserInput_Event")
  64.  
  65. local UIS = game:GetService("UserInputService")
  66. local input = function(io,a)
  67. if a then return end
  68. --Since InputObject is a client-side instance, we create and pass table instead
  69. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  70. end
  71. UIS.InputBegan:Connect(input)
  72. UIS.InputEnded:Connect(input)
  73.  
  74. local Mouse = Player:GetMouse()
  75. local h,t
  76. --Give the server mouse data 30 times every second, but only if the values changed
  77. --If player is not moving their mouse, client won't fire events
  78. while wait(1/30) do
  79. if h~=Mouse.Hit or t~=Mouse.Target then
  80. h,t=Mouse.Hit,Mouse.Target
  81. Event:FireServer({isMouse=true,Target=t,Hit=h})
  82. end
  83. end]==],Player.Character)
  84. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  85. end
  86.  
  87. --Knife Module Script
  88. --Perhapz
  89. wait(.2)
  90.  
  91. local thing = Instance.new("Tool",game.Players.LocalPlayer.Backpack)
  92. thing.Name = "Laser Knife"
  93. local handl3 = Instance.new("Part",thing)
  94. handl3.Name = "Handle"
  95. local sund = Instance.new("Sound",handl3)
  96. sund.Name = "Sound"
  97.  
  98. script.Parent = thing
  99. local meshh = Instance.new("SpecialMesh",handl3)
  100. meshh.MeshId = "http://www.roblox.com/asset/?id=121944778"
  101. meshh.TextureId = "http://www.roblox.com/asset/?id=177974585"
  102.  
  103.  
  104. local tool = script.Parent
  105. local player = owner
  106. local char = player.Character
  107. local humanoid = char:FindFirstChild("Humanoid")
  108. local camera = workspace.CurrentCamera
  109. local rightC1 = CFrame.new(-0.5, 0.7, 0) * CFrame.Angles(0, (math.pi / 2), 0)
  110. local leftC1 = CFrame.new(0, 0.7, 0) * CFrame.Angles(0, (math.pi / 2), 0)
  111. local equipping = false
  112. local gettingknife = false
  113. local laserCharge = false
  114. local playcharge = false
  115. local justthrown = false
  116. local canLaser = false
  117. local justattacked=false
  118. local thrownkniferotation=0
  119. local Damage = 110
  120. local Attacking = false
  121. local handle = nil
  122. local WalkSpeeds = {16,20}
  123. local fasterthrow = 2
  124. local knifespeed = 225
  125.  
  126.  
  127.  
  128. --[[if player.Gamepass4.Value == true then
  129. fasterthrow = 0.5
  130. else
  131. fasterthrow = 0.2
  132. end
  133. if player.Gamepass5.Value == true then
  134. knifespeed = 305
  135. else
  136. knifespeed = 225
  137. end
  138.  
  139. --]]
  140.  
  141. SOUNDS = {
  142. throwing = {"153647554"},
  143. laserthrowing = {"167775098"},
  144. shouts = {"170037553","141679994","170038933","138097458","246561524"},
  145. striking = {"153647529","153647534","153647539","153647540"},
  146. equip = {"153647514"},
  147. wallhit = {"153647564"},
  148. hitplayer = {"146594640","146457047","146594648"},
  149. deaths = {""},
  150. }
  151.  
  152. SETTINGS={
  153.  
  154. tool={
  155. tool_size=Vector3.new(0.4, 3, 0.7),
  156. tool_transparency=0,
  157. tool_color=BrickColor.Black(),
  158. default_tool_size=0.6,
  159. },
  160.  
  161. }
  162.  
  163. function DamageObject(hit)
  164. local char=hit.Parent
  165. if char and char~=player.Character and char.Name~="Arms_Model" and hit.Name~="Handle" then
  166. local h=char:FindFirstChild("Humanoid")
  167. if h and h.Health > 0 then
  168.  
  169. h:TakeDamage(Damage)
  170. PlaySound("Hit1")
  171. if h.Health == 0 then
  172. PlaySound("Hit2")
  173. end
  174. end
  175. end
  176. end
  177.  
  178. function PlaySound(name,ctorso)
  179. if name=="Throw" then
  180. tool.Handle.Sound.SoundId = "rbxassetid://" .. SOUNDS.throwing[math.random(1,#SOUNDS.throwing)]
  181. tool.Handle.Sound:Play()
  182. elseif name=="ThrowLaser" then
  183. tool.Handle.Sound.SoundId = "rbxassetid://" .. SOUNDS.laserthrowing[math.random(1,#SOUNDS.laserthrowing)]
  184. tool.Handle.Sound:Play()
  185. elseif name=="Equip" then
  186. tool.Handle.Sound.SoundId = "rbxassetid://" .. SOUNDS.equip
  187. tool.Handle.Sound:Play()
  188. elseif name=="Swing" then
  189. tool.Handle.Sound.SoundId = "rbxassetid://" .. SOUNDS.striking[math.random(1,#SOUNDS.striking)]
  190. tool.Handle.Sound:Play()
  191. elseif name=="Hit1" then
  192. local NewSound=tool.Handle.Sound:clone()
  193. NewSound.Parent=ctorso
  194. NewSound.SoundId = "rbxassetid://" .. SOUNDS.hitplayer[math.random(1,#SOUNDS.hitplayer)]
  195. NewSound:Play()
  196. NewSound:Destroy()
  197. --elseif name=="Hit2" then
  198. --local NewSound=tool.Handle.Sound:clone()
  199. --NewSound.Parent=ctorso
  200. --NewSound.SoundId = "rbxassetid://" .. SOUNDS.deaths[math.random(1,#SOUNDS.deaths)]
  201. --NewSound:Play()
  202. -- NewSound:Destroy()
  203. elseif name=="Laser" then
  204. local NewSound=tool.Handle.Sound
  205. NewSound.SoundId = "rbxassetid://" .. SOUNDS.shouts[math.random(1,#SOUNDS.shouts)]
  206. NewSound:Play()
  207.  
  208. end
  209. end
  210.  
  211. function Throwtool(dPos)
  212. if not tool.Handle then return end
  213. local throwingHandle = tool.Handle:Clone()
  214. game:GetService("Debris"):AddItem(throwingHandle, 5)
  215. throwingHandle.Transparency=0
  216. throwingHandle.Parent = workspace
  217. if player.Character and player.Character.Humanoid then
  218. throwingHandle.Velocity = (player.Character.Humanoid.TargetPoint - throwingHandle.CFrame.p).unit * knifespeed
  219. if canLaser then
  220. throwingHandle.Velocity = (player.Character.Humanoid.TargetPoint - throwingHandle.CFrame.p).unit * 15000
  221. end
  222. if mouse.Target ~= nil then
  223. if mouse.Target.Parent.Name~="Arms_Model" and mouse.Target.Name~="ThrownKnife" and mouse.Target.Name~="Handle" then
  224. targetpos=player.Character.Humanoid.TargetPoint
  225. else
  226. targetpos=Vector3.new(0,-10,0)
  227. end
  228. end
  229. -- set the orientation to the direction it is being thrown in
  230. throwingHandle.CFrame = CFrame.new(throwingHandle.CFrame.p, throwingHandle.CFrame.p + throwingHandle.Velocity) * CFrame.Angles(0, 0, math.rad(-90))
  231. local floatingForce = Instance.new('BodyForce', throwingHandle)
  232. floatingForce.force = Vector3.new(0, 196.2 * throwingHandle:GetMass() * 0.98, 0)
  233. local spin = Instance.new('BodyAngularVelocity', throwingHandle)
  234. spin.angularvelocity = throwingHandle.CFrame:vectorToWorldSpace(Vector3.new(0, -400, 0))
  235. spawnPos=player.Character.PrimaryPart.Position
  236. spawnPos = spawnPos + dPos*5
  237. if canLaser then
  238. local Ray = Ray.new(tool.Handle.CFrame.p,(mouse.Hit.p - tool.Handle.CFrame.p).unit * 999)
  239. local Hit,Position = game.Workspace:FindPartOnRay(Ray,char)
  240. if Hit then
  241. if Hit.Parent:FindFirstChild("Humanoid") then
  242. throwingHandle:Destroy()
  243. Hit.Parent.Humanoid:TakeDamage(110)
  244. laserCharge=true
  245. end end
  246. local RayPart = Instance.new("Part",workspace)
  247. RayPart.Name = "RayPart"
  248. RayPart.BrickColor = BrickColor.new("Really red")
  249. RayPart.Transparency = 0
  250. RayPart.Anchored = true
  251. RayPart.CanCollide = false
  252. RayPart.TopSurface = Enum.SurfaceType.Smooth
  253. RayPart.BottomSurface = Enum.SurfaceType.Smooth
  254. RayPart.formFactor = Enum.FormFactor.Custom
  255. local Distance = (Position-tool.Handle.CFrame.p).magnitude
  256. RayPart.Size = Vector3.new(0.2,0.2,Distance)
  257. RayPart.CFrame = CFrame.new(Position,tool.Handle.CFrame.p) * CFrame.new(0,0,-Distance/2)
  258. game.Debris:addItem(RayPart,.5)
  259. PlaySound("Laser")
  260. for v=1, 10 do
  261. RayPart.Transparency = 0.1 * v
  262. wait()
  263. end
  264.  
  265. end
  266. end
  267. if throwingHandle then
  268.  
  269. local touchedConn = throwingHandle.Touched:connect(function(hit)
  270. local char=hit.Parent
  271. camera.CameraSubject=humanoid
  272. camera.CameraType=Enum.CameraType.Custom
  273. if char and char~=player.Character and char.Name~="Arms_Model" and hit.Name~="Handle" and hit.Name~="RayPart" then
  274. local h=char:FindFirstChild("Humanoid")
  275. if h and h.Health > 0 then
  276. throwingHandle:Destroy()
  277. laserCharge=true
  278. if hit.Name~="Head" or hit.className=="Hat" then
  279. h:TakeDamage(Damage)
  280. -- player.Credits.Value = player.Credits.Value + 15
  281. --player.PlayerGui.NormalKillGui.Script.Disabled = false
  282.  
  283. if h.Health == 0 then
  284. PlaySound("Hit2",char.Torso)
  285. end
  286. else
  287. h:TakeDamage(Damage * 2)
  288. print("Headshot!")
  289. --player.Credits.Value = player.Credits.Value + 50
  290. --player.PlayerGui.HeadShotGui.Script.Disabled = false
  291. char.Head.Transparency=1
  292. char.Head.CanCollide=false
  293. if char.Head:FindFirstChild("face") then char.Head:FindFirstChild("face").Transparency=1 end
  294. for _,v in pairs(char:GetChildren()) do
  295. if v.className=="Hat" then
  296. v:Destroy()
  297. end
  298. end
  299. for i = 1, 7 do
  300. local blood=Instance.new("Part")
  301. blood.FormFactor="Custom"
  302. blood.Size=Vector3.new(1,.2,1)
  303. blood.BrickColor=BrickColor.Red()
  304. blood.TopSurface=0
  305. blood.BottomSurface=0
  306. game:GetService("Debris"):AddItem(blood,5)
  307. blood.Parent=workspace
  308. blood.Position=char.Head.Position + Vector3.new(math.random(0.2,0.8),0,math.random(0.2,0.8))
  309. end
  310. local sound = Instance.new("Sound")
  311. sound.SoundId = "rbxassetid://142347633"
  312. sound.Parent=char.Head
  313. sound.Pitch=1.1
  314. sound:Play()
  315. end
  316. PlaySound("Hit1")
  317. if h.Health == 0 then
  318. PlaySound("Hit2")
  319. end
  320. elseif hit.Name~="Handle" or hit.Name~="IgnoreThrowingKnives" and hit.Parent.Name~="Arms_Model" and hit.Name~="RayPart" and hit.CanCollide==true then
  321. local sound=Instance.new("Sound")
  322. sound.Parent=hit
  323. sound.SoundId = "rbxassetid://" .. SOUNDS.wallhit[math.random(1,#SOUNDS.wallhit)]
  324. sound:Play()
  325. sound:Destroy()
  326. print("Hit Object: " .. hit.Name)
  327. local newknife=tool.Handle:clone()
  328. newknife.Name="ThrownKnife"
  329. newknife.CFrame = CFrame.new(spawnPos, spawnPos + dPos) * CFrame.Angles(math.pi/-2, 0, 0)
  330. newknife.Position = targetpos
  331. throwingHandle:Destroy()
  332. newknife.Anchored=true
  333. newknife.CanCollide=true
  334. newknife.Transparency=0
  335. newknife.Parent=workspace
  336. --newknife.Script.Disabled = false
  337. wait(7)
  338. for i=1,10 do
  339. newknife.Transparency=i*.1
  340. wait()
  341. end
  342. newknife:Destroy()
  343. end
  344. end
  345. end)
  346. end
  347. end
  348. -- must check if it still exists since we waited
  349. if throwingHandle then
  350. throwingHandle.CanCollide = true
  351. end
  352.  
  353. FUNCTIONS={
  354.  
  355. CHECKFORFIRSTPERSON=function()
  356. if (camera.focus.p - camera.CoordinateFrame.p).magnitude > 1 then
  357. return false
  358. else
  359. return true
  360. end
  361. end,
  362.  
  363. ANIMS=function(state)
  364. if state then
  365. mouse.Icon="http://www.roblox.com/asset/?id=139669907"
  366. --Start Animation
  367.  
  368. if SETTINGS.tool then
  369. tool.GripPos = Vector3.new(0, -0.55, 0)
  370. elseif SETTINGS.tool then
  371. tool.GripPos = Vector3.new(0, -0.6, 0)
  372. elseif SETTINGS.tool then
  373. tool.GripPos = Vector3.new(0, -0.65, 0)
  374. elseif SETTINGS.tool then
  375. tool.GripPos = Vector3.new(0, -0.7, 0)
  376. elseif SETTINGS.tool then
  377. tool.GripPos = Vector3.new(0, -0.75, 0)
  378. elseif SETTINGS.tool then
  379. tool.GripPos = Vector3.new(0, -0.8, 0)
  380. elseif SETTINGS.tool then
  381. tool.GripPos = Vector3.new(0, -0.85, 0)
  382. elseif SETTINGS.tool then
  383. tool.GripPos = Vector3.new(0, -0.9, 0)
  384. elseif SETTINGS.tool then
  385. tool.GripPos = Vector3.new(0, -0.95, 0)
  386. elseif SETTINGS.tool then
  387. tool.GripPos = Vector3.new(0, -1, 0)
  388. else
  389. print("Invalid tool size! Set to default: " .. SETTINGS.tool.default_tool_size )
  390.  
  391. if SETTINGS.tool.default_tool_size==.1 then
  392. tool.GripPos = Vector3.new(0, -0.55, 0)
  393. elseif SETTINGS.tool.default_tool_size==.2 then
  394. tool.GripPos = Vector3.new(0, -0.6, 0)
  395. elseif SETTINGS.tool.default_tool_size==.3 then
  396. tool.GripPos = Vector3.new(0, -0.65, 0)
  397. elseif SETTINGS.tool.default_tool_size==.4 then
  398. tool.GripPos = Vector3.new(0, -0.7, 0)
  399. elseif SETTINGS.tool.default_tool_size==.5 then
  400. tool.GripPos = Vector3.new(0, -0.75, 0)
  401. elseif SETTINGS.tool.default_tool_size==.6 then
  402. tool.GripPos = Vector3.new(0, -0.8, 0)
  403. elseif SETTINGS.tool.default_tool_size==.7 then
  404. tool.GripPos = Vector3.new(0, -0.85, 0)
  405. elseif SETTINGS.tool.default_tool_size==.8 then
  406. tool.GripPos = Vector3.new(0, -0.9, 0)
  407. elseif SETTINGS.tool.default_tool_size==.9 then
  408. tool.GripPos = Vector3.new(0, -0.95, 0)
  409. elseif SETTINGS.tool.default_tool_size==1 then
  410. tool.GripPos = Vector3.new(0, -1, 0)
  411. else
  412. print("Invalid default size! Un-equipping and removing Knife...")
  413.  
  414. end
  415. end
  416. torso=char:FindFirstChild("Torso")
  417. leftarm=torso:FindFirstChild("Left Shoulder")
  418. if leftarm then
  419. leftarm.Parent=nil
  420. newarmweld=Instance.new("Weld")
  421. newarmweld.Name="LeftWeld"
  422. newarmweld.Part0=torso
  423. newarmweld.C0 = CFrame.new(-1.5, 0.7, 0)
  424. newarmweld.C1 = CFrame.new(0, 0.7, 0)
  425. newarmweld.Part1=char:FindFirstChild("Left Arm")
  426. newarmweld.Parent=torso
  427. end
  428. humanoid.WalkSpeed=WalkSpeeds[2]
  429. for i = 1, 15, 3 do
  430. if equipped then
  431. torso:FindFirstChild("Right Shoulder").C1 = rightC1 * CFrame.Angles((-i * (math.pi / 90)),(-i * (math.pi / 90)),(i * (math.pi / 210)))
  432. torso:FindFirstChild("LeftWeld").C1 = CFrame.new(-0.2, .7, 0) * CFrame.Angles((-i * (math.pi / 60)),(i * (math.pi / 90)),(-i * (math.pi / 240)))
  433. end
  434. wait()
  435. end
  436. else
  437. humanoid.WalkSpeed=WalkSpeeds[1]
  438. torso:FindFirstChild("Right Shoulder").C1 = rightC1 * CFrame.new(0,-0.2,0)
  439. tool.GripForward = Vector3.new(0,0,-1)
  440. newarmweld:Destroy()
  441. leftarm.Parent=torso
  442. mouse.Icon=""
  443. torso:FindFirstChild("Neck").C0 = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  444. torso:FindFirstChild("Right Shoulder").C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  445. end
  446. end
  447. }
  448.  
  449. tool.Equipped:connect(function ()
  450. equipped=true
  451. PlaySound("Equip")
  452. FUNCTIONS.ANIMS(true)
  453. end)
  454. tool.Unequipped:connect(function ()
  455. equipped=false
  456. FUNCTIONS.ANIMS(false)
  457. end)
  458. tool.Handle.Touched:connect(function (hit)
  459. if Attacking then
  460. DamageObject(hit)
  461. end
  462. end)
  463. tool.Activated:connect(function ()
  464. if Attacking then return end
  465. if not tool.Enabled then return end
  466. justthrown=false
  467. justattacked=false
  468. if not gettingknife and not justthrown and not Attacking then
  469. HeldTime=time()
  470. end
  471. playcharge=true
  472. wait(.15)
  473. while gettingknife do
  474. wait()
  475. end
  476. local speed=0.2
  477. for i = 1, 15, fasterthrow do
  478. if playcharge and equipped and not gettingknife and not justthrown and not Attacking then
  479. 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)))
  480. 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)
  481. 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)
  482. wait()
  483. end
  484. end
  485. if playcharge then
  486. canLaser=true
  487. end
  488. end)
  489. tool.Deactivated:connect(function ()
  490. if not tool.Enabled then return end
  491. currTime=time()
  492. playcharge=false
  493. if HeldTime and currTime - HeldTime > 0.2 and
  494. currTime - HeldTime > 0.01 and not justthrown and not gettingknife then
  495. if not Attacking and not justattacked then
  496. print("Throw")
  497. if canLaser then
  498. PlaySound("ThrowLaser")
  499. else
  500. PlaySound("Throw")
  501. end
  502. tool.Handle.Transparency=1
  503. local targetPos = player.Character.Humanoid.TargetPoint
  504. local lookAt = (targetPos - player.Character.PrimaryPart.Position).unit
  505. local switchEvenOddParity = 1
  506. local angle = math.ceil((1-1)/2)*math.pi/12*switchEvenOddParity
  507. Throwtool(CFrame.Angles(0, angle, 0) * lookAt)
  508. wait()
  509. canLaser=false
  510. HeldTime=0
  511. gettingknife=true
  512. mouse.Icon="http://www.roblox.com/asset/?id=139669907"
  513. player.Character["Right Arm"].RightGrip.C1 = CFrame.new(0, -0.800000012, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  514. for i = 1, 15, .8 do
  515. if equipped then
  516. 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)))
  517. 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)))
  518. wait()
  519. end
  520. end
  521. justthrown=true
  522. tool.Handle.Transparency=0
  523. PlaySound("Equip")
  524. mouse.Icon="http://www.roblox.com/asset/?id=139669907"
  525. tool.GripForward = Vector3.new(0,0,-1)
  526. for i = 1, 15, 1 do
  527. if equipped then
  528. 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)))
  529. wait()
  530. end
  531. end
  532. gettingknife=false
  533. for i = 1, 15, 3 do
  534. if equipped then
  535. torso:FindFirstChild("Right Shoulder").C1 = rightC1 * CFrame.Angles((-i * (math.pi / 90)),(-i * (math.pi / 90)),(i * (math.pi / 210)))
  536. torso:FindFirstChild("LeftWeld").C1 = CFrame.new(-0.2, .7, 0) * CFrame.Angles((-i * (math.pi / 60)),(i * (math.pi / 90)),(-i * (math.pi / 240)))
  537. end
  538. wait()
  539. end
  540. end
  541. else
  542. if not justthrown and not gettingknife then
  543. if Attacking then return end
  544. print("Attack")
  545. HeldTime=0
  546. Attacking=true
  547. justattacked=true
  548. if math.random(1,2)==1 then
  549. for i = 1, 15, 3 do
  550. if equipped and not gettingknife and not justthrown then
  551. 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)))
  552. 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)
  553. wait()
  554. end
  555. end
  556. PlaySound("Swing")
  557. for i = 1, 15, 3 do
  558. if equipped and not gettingknife and not justthrown then
  559. 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)))
  560. 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)))
  561. wait()
  562. end
  563. end
  564. for i = 1, 15, 3 do
  565. if equipped and not justthrown and not gettingknife then
  566. 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)))
  567. wait()
  568. end
  569. end
  570. for i = 1, 15, 3 do
  571. equipping=true
  572. if equipped and not gettingknife and not justthrown then
  573. torso:FindFirstChild("Right Shoulder").C1 = rightC1 * CFrame.Angles((-i * (math.pi / 90)),(-i * (math.pi / 90)),(i * (math.pi / 210)))
  574. torso:FindFirstChild("LeftWeld").C1 = CFrame.new(-0.2, .7, 0) * CFrame.Angles((-i * (math.pi / 60)),(i * (math.pi / 90)),(-i * (math.pi / 240)))
  575. end
  576. wait()
  577. end
  578. Attacking=false
  579. else
  580. for i = 1, 15, 3 do
  581. if equipped and not gettingknife and not justthrown then
  582. 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)))
  583. end
  584. wait()
  585. end
  586. PlaySound("Swing")
  587. for i = 1, 15, 3 do
  588. if equipped and not gettingknife and not justthrown then
  589. 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)
  590. 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)))
  591. end
  592. wait()
  593. end
  594. for i = 1, 15, 3 do
  595. if equipped and not gettingknife and not justthrown then
  596. 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)
  597. end
  598. wait()
  599. end
  600. for i = 1, 15, 3 do
  601. if equipped and not gettingknife and not justthrown then
  602. torso:FindFirstChild("Right Shoulder").C1 = rightC1 * CFrame.Angles((-i * (math.pi / 90)),(-i * (math.pi / 90)),(i * (math.pi / 210)))
  603. torso:FindFirstChild("LeftWeld").C1 = CFrame.new(-0.2, .7, 0) * CFrame.Angles((-i * (math.pi / 60)),(i * (math.pi / 90)),(-i * (math.pi / 240)))
  604. end
  605. wait()
  606. end
  607. Attacking=false
  608. end
  609. end
  610. end
  611. end)
  612.  
  613. mouse.Move:connect(function ()
  614. if equipped and mouse then
  615. if (mouse.Hit.p - mouse.Origin.p).unit.y < 0.25 and (mouse.Hit.p - mouse.Origin.p).unit.y > -0.25 then
  616. 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))
  617. 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))
  618. 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)
  619. end
  620. end
  621. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement