Advertisement
Ahtoh13131423144235

Roblox Knife Script

Oct 20th, 2017
10,919
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.34 KB | None | 0 0
  1. --Made by Ahtoh13131423144235
  2.  
  3. local player=game.Players.LocalPlayer
  4. local mouse=player:GetMouse()
  5. local char=player.Character
  6. local debounce=false
  7. local damage=false
  8. local damage1=false
  9.  
  10. local create={
  11. ["Part"]=function(parent,x,y,z,anchored,canCollide,color,transparency,name)
  12. local part=Instance.new("Part")
  13. part.Parent=parent
  14. part.Name=name
  15. part.Size=Vector3.new(x,y,z)
  16. part.Anchored=anchored
  17. part.CanCollide=canCollide
  18. part.BrickColor=BrickColor.new(color)
  19. part.Transparency=transparency
  20. part.Position=Vector3.new(0,70,0)
  21. part.Locked=true
  22. return part
  23. end,
  24. ["Weld"]=function(parent,name,x,y,z,x2,y2,z2,x3,y3,z3,x4,y4,z4,part0,part1)
  25. local weld=Instance.new("Weld")
  26. weld.Parent=parent
  27. weld.Name=name
  28. weld.C0=CFrame.new(x,y,z)*CFrame.fromEulerAnglesXYZ(x2,y2,z2)
  29. weld.C1=CFrame.new(x3,y3,z3)*CFrame.fromEulerAnglesXYZ(x4,y4,z4)
  30. weld.Part0=part0
  31. weld.Part1=part1
  32. return weld
  33. end,
  34. ["Mesh"]=function(parent,name,x,y,z,x2,y2,z2,meshType,texture,id)
  35. local mesh=Instance.new("SpecialMesh")
  36. mesh.Parent=parent
  37. mesh.Name=name
  38. mesh.Offset=Vector3.new(x,y,z)
  39. mesh.Scale=Vector3.new(x2,y2,z2)
  40. mesh.MeshType=meshType
  41. if meshType=="FileMesh" then
  42. mesh.TextureId=texture
  43. mesh.MeshId=id
  44. end
  45. return mesh
  46. end
  47. }
  48.  
  49. local torso=create.Part(char,2,2,1,false,false,char.Torso.Color,0,"FakeTorso")
  50. local torsoWeld=create.Weld(char.Torso,"FakeTorsoWeld",0,0,0,0,0,0,0,0,0,0,0,0,char.Torso,torso)
  51. local arm1=create.Part(char,1,2,1,false,false,char["Right Arm"].Color,0,"Arm1")
  52. local arm1Weld=create.Weld(char.Torso,"Arm1Weld",1.5,0.5,0,0,0,0,0,0.5,0,0,0,0,char.Torso,arm1)
  53. local arm2=create.Part(char,1,2,1,false,false,char["Left Arm"].Color,0,"Arm2")
  54. local arm2Weld=create.Weld(char.Torso,"Arm2Weld",-1.5,0.5,0,0,0,0,0,0.5,0,0,0,0,char.Torso,arm2)
  55. local leg1=create.Part(char,1,2,1,false,false,char["Right Leg"].Color,0,"Leg1")
  56. local leg1Weld=create.Weld(char.Torso,"Leg1Weld",0.5,-2,0,0,0,0,0,0,0,0,0,0,char.Torso,leg1)
  57. local leg2=create.Part(char,1,2,1,false,false,char["Left Leg"].Color,0,"Leg2")
  58. local leg2Weld=create.Weld(char.Torso,"Leg2Weld",-0.5,-2,0,0,0,0,0,0,0,0,0,0,char.Torso,leg2)
  59. local handle=create.Part(char,0.6,0.7,0.4,false,false,"Dark orange",0,"KnifeHandle")
  60. local handleWeld=create.Weld(arm1,"HandleWeld",0,-1.2,0,0,1.57,-1.57,0,0,0,0,0,0,arm1,handle)
  61. local blade1=create.Part(char,0.4,1,0.1,false,false,"White",0,"KnifeBlade1")
  62. local blade1Weld=create.Weld(handle,"Blade1Weld",0,0.8,0,0,0,0,0,0,0,0,0,0,handle,blade1)
  63. local blade2=create.Part(char,0.1,0.4,0.4,false,false,"White",0,"KnifeBlade2")
  64. local blade2Weld=create.Weld(handle,"Blade2Weld",0,1.5,0,0,1.57,0,0,0,0,0,0,0,handle,blade2)
  65. local blade2Mesh=create.Mesh(blade2,"KnifeBlade2Mesh",0,0,0,1,1,1,"Wedge")
  66. char.Torso.Transparency=1
  67. char["Right Arm"].Transparency=1
  68. char["Left Arm"].Transparency=1
  69. char["Right Leg"].Transparency=1
  70. char["Left Leg"].Transparency=1
  71.  
  72. local animate={
  73. ["Torso"]=function(cf)
  74. torsoWeld.C0=CFrame.new(0,0,0)*cf
  75. end,
  76. ["Arm1"]=function(cf)
  77. arm1Weld.C0=CFrame.new(1.5,0.5,0)*cf
  78. end,
  79. ["Arm2"]=function(cf)
  80. arm2Weld.C0=CFrame.new(-1.5,0.5,0)*cf
  81. end,
  82. ["Leg1"]=function(cf)
  83. leg1Weld.C0=CFrame.new(0.5,-2,0)*cf
  84. end,
  85. ["Leg2"]=function(cf)
  86. leg2Weld.C0=CFrame.new(-0.5,-2,0)*cf
  87. end,
  88. ["Head"]=function(cf)
  89. char.Torso.Neck.C0=CFrame.new(0,0.5,0)*cf
  90. end
  91. }
  92.  
  93. mouse.KeyDown:connect(function(key)
  94. if key=="q" and debounce==false then
  95. debounce=true
  96. animate.Leg1(CFrame.fromEulerAnglesXYZ(-0.1,0,0))
  97. wait()
  98. animate.Leg1(CFrame.fromEulerAnglesXYZ(-0.2,0,0))
  99. wait()
  100. animate.Leg1(CFrame.fromEulerAnglesXYZ(-0.3,0,0))
  101. wait()
  102. animate.Leg1(CFrame.fromEulerAnglesXYZ(-0.4,0,0))
  103. wait()
  104. animate.Leg1(CFrame.fromEulerAnglesXYZ(-0.5,0,0))
  105. wait(0.5)
  106. damage1=true
  107. animate.Leg1(CFrame.fromEulerAnglesXYZ(-0.4,0,0))
  108. wait()
  109. animate.Leg1(CFrame.fromEulerAnglesXYZ(-0.3,0,0))
  110. wait()
  111. animate.Leg1(CFrame.fromEulerAnglesXYZ(-0.2,0,0))
  112. wait()
  113. animate.Leg1(CFrame.fromEulerAnglesXYZ(-0.1,0,0))
  114. wait()
  115. animate.Leg1(CFrame.fromEulerAnglesXYZ(0.1,0,0))
  116. wait()
  117. animate.Leg1(CFrame.fromEulerAnglesXYZ(0.2,0,0))
  118. wait()
  119. animate.Leg1(CFrame.fromEulerAnglesXYZ(0.3,0,0))
  120. wait()
  121. animate.Leg1(CFrame.fromEulerAnglesXYZ(0.4,0,0))
  122. wait(0.1)
  123. animate.Leg1(CFrame.fromEulerAnglesXYZ(0.3,0,0))
  124. wait()
  125. animate.Leg1(CFrame.fromEulerAnglesXYZ(0.2,0,0))
  126. wait()
  127. animate.Leg1(CFrame.fromEulerAnglesXYZ(0.1,0,0))
  128. wait()
  129. animate.Leg1(CFrame.fromEulerAnglesXYZ(0,0,0))
  130. wait()
  131. debounce=false
  132. damage1=false
  133. end
  134. end)
  135.  
  136. mouse.Button1Down:connect(function()
  137. if debounce==false then
  138. debounce=true
  139. animate.Arm1(CFrame.fromEulerAnglesXYZ(-0.1,0,0))
  140. wait()
  141. animate.Arm1(CFrame.fromEulerAnglesXYZ(-0.2,0,0))
  142. wait()
  143. animate.Arm1(CFrame.fromEulerAnglesXYZ(-0.3,0,0))
  144. wait()
  145. animate.Arm1(CFrame.fromEulerAnglesXYZ(-0.4,0,0))
  146. wait()
  147. animate.Arm1(CFrame.fromEulerAnglesXYZ(-0.5,0,0))
  148. wait(0.5)
  149. damage=true
  150. animate.Arm1(CFrame.fromEulerAnglesXYZ(-0.4,0,0))
  151. wait()
  152. animate.Arm1(CFrame.fromEulerAnglesXYZ(-0.3,0,0))
  153. wait()
  154. animate.Arm1(CFrame.fromEulerAnglesXYZ(-0.2,0,0))
  155. wait()
  156. animate.Arm1(CFrame.fromEulerAnglesXYZ(-0.1,0,0))
  157. wait()
  158. animate.Arm1(CFrame.fromEulerAnglesXYZ(0.1,0,0))
  159. wait()
  160. animate.Arm1(CFrame.fromEulerAnglesXYZ(0.2,0,0))
  161. wait()
  162. animate.Arm1(CFrame.fromEulerAnglesXYZ(0.3,0,0))
  163. wait()
  164. animate.Arm1(CFrame.fromEulerAnglesXYZ(0.4,0,0))
  165. wait()
  166. animate.Arm1(CFrame.fromEulerAnglesXYZ(0.5,0,0))
  167. wait()
  168. animate.Arm1(CFrame.fromEulerAnglesXYZ(0.6,0,0))
  169. wait()
  170. animate.Arm1(CFrame.fromEulerAnglesXYZ(0.7,0,0))
  171. wait()
  172. animate.Arm1(CFrame.fromEulerAnglesXYZ(0.8,0,0))
  173. wait()
  174. animate.Arm1(CFrame.fromEulerAnglesXYZ(0.9,0,0))
  175. wait(0.1)
  176. animate.Arm1(CFrame.fromEulerAnglesXYZ(0.8,0,0))
  177. wait()
  178. animate.Arm1(CFrame.fromEulerAnglesXYZ(0.7,0,0))
  179. wait()
  180. animate.Arm1(CFrame.fromEulerAnglesXYZ(0.6,0,0))
  181. wait()
  182. animate.Arm1(CFrame.fromEulerAnglesXYZ(0.5,0,0))
  183. wait()
  184. animate.Arm1(CFrame.fromEulerAnglesXYZ(0.4,0,0))
  185. wait()
  186. animate.Arm1(CFrame.fromEulerAnglesXYZ(0.3,0,0))
  187. wait()
  188. animate.Arm1(CFrame.fromEulerAnglesXYZ(0.2,0,0))
  189. wait()
  190. animate.Arm1(CFrame.fromEulerAnglesXYZ(0.1,0,0))
  191. wait()
  192. animate.Arm1(CFrame.fromEulerAnglesXYZ(0,0,0))
  193. damage=false
  194. debounce=false
  195. end
  196. end)
  197.  
  198. blade2.Touched:connect(function(hit)
  199. if hit.Parent:FindFirstChild("Humanoid")~=nil and damage==true then
  200. damage=false
  201. hit.Parent.Humanoid.Health=0
  202. end
  203. end)
  204.  
  205. leg1.Touched:connect(function(hit)
  206. if hit.Parent:FindFirstChild("Humanoid")~=nil and damage1==true then
  207. damage1=false
  208. hit.Parent.Humanoid.Sit=true
  209. end
  210. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement