Advertisement
Ahtoh13131423144235

Roblox Combat Script

Oct 11th, 2017
14,727
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 9.63 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 canAttack=false
  7. local run=false
  8. local runDebounce=false
  9. local damageArm1=false
  10. local damageArm2=false
  11. local damageLeg1=false
  12. local damageLeg2=false
  13. local damageTorso=false
  14. local sit=false
  15.  
  16. local create={
  17. ["Part"]=function(parent,x,y,z,anchored,canCollide,color,transparency,name)
  18. local part=Instance.new("Part")
  19. part.Parent=parent
  20. part.Name=name
  21. part.Size=Vector3.new(x,y,z)
  22. part.Anchored=anchored
  23. part.CanCollide=canCollide
  24. part.BrickColor=BrickColor.new(color)
  25. part.Transparency=transparency
  26. part.Locked=true
  27. return part
  28. end,
  29. ["Weld"]=function(parent,name,x,y,z,x2,y2,z2,x3,y3,z3,x4,y4,z4,part0,part1)
  30. local weld=Instance.new("Weld")
  31. weld.Parent=parent
  32. weld.Name=name
  33. weld.C0=CFrame.new(x,y,z)*CFrame.fromEulerAnglesXYZ(x2,y2,z2)
  34. weld.C1=CFrame.new(x3,y3,z3)*CFrame.fromEulerAnglesXYZ(x4,y4,z4)
  35. weld.Part0=part0
  36. weld.Part1=part1
  37. return weld
  38. end
  39. }
  40.  
  41. local torso=create.Part(char,2,2,1,false,false,char.Torso.Color,0,"FakeTorso")
  42. local torsoWeld=create.Weld(char.Torso,"FakeTorsoWeld",0,0,0,0,0,0,0,0,0,0,0,0,char.Torso,torso)
  43. local arm1=create.Part(char,1,2,1,false,false,char["Right Arm"].Color,0,"Arm1")
  44. 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)
  45. local arm2=create.Part(char,1,2,1,false,false,char["Left Arm"].Color,0,"Arm2")
  46. 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)
  47. local leg1=create.Part(char,1,2,1,false,false,char["Right Leg"].Color,0,"Leg1")
  48. local leg1Weld=create.Weld(char.Torso,"Leg1Weld",0.5,-2,0,0,0,0,0,0,0,0,0,0,char.Torso,leg1)
  49. local leg2=create.Part(char,1,2,1,false,false,char["Left Leg"].Color,0,"Leg2")
  50. local leg2Weld=create.Weld(char.Torso,"Leg2Weld",-0.5,-2,0,0,0,0,0,0,0,0,0,0,char.Torso,leg2)
  51. char.Torso.Transparency=1
  52. char["Right Arm"].Transparency=1
  53. char["Left Arm"].Transparency=1
  54. char["Right Leg"].Transparency=1
  55. char["Left Leg"].Transparency=1
  56.  
  57. for i=1,3 do
  58. arm1Weld.C0=arm1Weld.C0*CFrame.fromEulerAnglesXYZ(0,0,0.1)
  59. arm2Weld.C0=arm2Weld.C0*CFrame.fromEulerAnglesXYZ(0,0,-0.1)
  60. wait()
  61. end
  62. canAttack=true
  63.  
  64. char.Humanoid.Running:connect(function(speed)
  65. if speed>0.01 then
  66. run=true
  67. elseif speed<=0 then
  68. run=false
  69. end
  70. end)
  71.  
  72.  
  73. game["Run Service"].RenderStepped:connect(function()
  74. if run==true and runDebounce==false and canAttack==true then
  75. runDebounce=true
  76. for i=1,5 do
  77. leg1Weld.C0=leg1Weld.C0*CFrame.fromEulerAnglesXYZ(-0.1,0,0)
  78. leg2Weld.C0=leg2Weld.C0*CFrame.fromEulerAnglesXYZ(0.1,0,0)
  79. wait()
  80. end
  81. for i=1,10 do
  82. leg1Weld.C0=leg1Weld.C0*CFrame.fromEulerAnglesXYZ(0.1,0,0)
  83. leg2Weld.C0=leg2Weld.C0*CFrame.fromEulerAnglesXYZ(-0.1,0,0)
  84. wait()
  85. end
  86. for i=1,5 do
  87. leg1Weld.C0=leg1Weld.C0*CFrame.fromEulerAnglesXYZ(-0.1,0,0)
  88. leg2Weld.C0=leg2Weld.C0*CFrame.fromEulerAnglesXYZ(0.1,0,0)
  89. wait()
  90. end
  91. runDebounce=false
  92. end
  93. end)
  94.  
  95. mouse.KeyDown:connect(function(key)
  96. if canAttack==true and key=="q" then
  97. canAttack=false
  98. for i=1,3 do
  99. arm1Weld.C0=arm1Weld.C0*CFrame.fromEulerAnglesXYZ(0,0,-0.1)
  100. wait()
  101. end
  102. for i=1,16 do
  103. arm1Weld.C0=arm1Weld.C0*CFrame.fromEulerAnglesXYZ(0.1,0,0)
  104. wait()
  105. end
  106. damageArm1=true
  107. for i=1,27 do
  108. arm1Weld.C0=arm1Weld.C0*CFrame.new(0,-0.1,0)
  109. wait()
  110. end
  111. for i=1,27 do
  112. arm1Weld.C0=arm1Weld.C0*CFrame.new(0,0.1,0)
  113. wait()
  114. end
  115. damageArm1=false
  116. for i=1,16 do
  117. arm1Weld.C0=arm1Weld.C0*CFrame.fromEulerAnglesXYZ(-0.1,0,0)
  118. wait()
  119. end
  120. for i=1,3 do
  121. arm1Weld.C0=arm1Weld.C0*CFrame.fromEulerAnglesXYZ(0,0,0.1)
  122. wait()
  123. end
  124. canAttack=true
  125. elseif canAttack==true and key=="e" then
  126. canAttack=false
  127. for i=1,3 do
  128. arm2Weld.C0=arm2Weld.C0*CFrame.fromEulerAnglesXYZ(0,0,0.1)
  129. wait()
  130. end
  131. for i=1,16 do
  132. arm2Weld.C0=arm2Weld.C0*CFrame.fromEulerAnglesXYZ(0.1,0,0)
  133. wait()
  134. end
  135. damageArm2=true
  136. for i=1,27 do
  137. arm2Weld.C0=arm2Weld.C0*CFrame.new(0,-0.1,0)
  138. wait()
  139. end
  140. for i=1,27 do
  141. arm2Weld.C0=arm2Weld.C0*CFrame.new(0,0.1,0)
  142. wait()
  143. end
  144. damageArm2=false
  145. for i=1,16 do
  146. arm2Weld.C0=arm2Weld.C0*CFrame.fromEulerAnglesXYZ(-0.1,0,0)
  147. wait()
  148. end
  149. for i=1,3 do
  150. arm2Weld.C0=arm2Weld.C0*CFrame.fromEulerAnglesXYZ(0,0,-0.1)
  151. wait()
  152. end
  153. canAttack=true
  154. elseif canAttack==true and key=="r" then
  155. canAttack=false
  156. char.Humanoid.WalkSpeed=0
  157. for i=1,4 do
  158. char.Torso.Neck.C0=char.Torso.Neck.C0*CFrame.fromEulerAnglesXYZ(0.1,0,0)
  159. wait()
  160. end
  161. wait(4)
  162. local explosion=Instance.new("Explosion")
  163. explosion.Parent=char
  164. explosion.BlastPressure=0
  165. explosion.Position=torso.Position
  166. explosion.Hit:connect(function(hit)
  167. if hit.Parent:FindFirstChild("Humanoid")~=nil and hit.Parent~=char then
  168. hit.Parent.Humanoid.Health=0
  169. end
  170. end)
  171. for i=1,4 do
  172. char.Torso.Neck.C0=char.Torso.Neck.C0*CFrame.fromEulerAnglesXYZ(-0.1,0,0)
  173. wait()
  174. end
  175. char.Humanoid.WalkSpeed=16
  176. canAttack=true
  177. elseif canAttack==true and key=="t" then
  178. canAttack=false
  179. for i=1,10 do
  180. leg1Weld.C0=leg1Weld.C0*CFrame.fromEulerAnglesXYZ(-0.1,0,0)
  181. wait()
  182. end
  183. damageLeg1=true
  184. for i=1,16 do
  185. leg1Weld.C0=leg1Weld.C0*CFrame.fromEulerAnglesXYZ(0.1,0,0)
  186. wait()
  187. end
  188. for i=1,6 do
  189. leg1Weld.C0=leg1Weld.C0*CFrame.fromEulerAnglesXYZ(-0.1,0,0)
  190. wait()
  191. end
  192. damageLeg1=false
  193. canAttack=true
  194. elseif canAttack==true and key=="y" then
  195. canAttack=false
  196. char.Humanoid.WalkSpeed=0
  197. char.Humanoid.JumpPower=0
  198. for i=1,16 do
  199. leg1Weld.C0=leg1Weld.C0*CFrame.fromEulerAnglesXYZ(0.1,0,0)
  200. leg2Weld.C0=leg2Weld.C0*CFrame.fromEulerAnglesXYZ(0.1,0,0)
  201. wait()
  202. end
  203. for i=1,5 do
  204. leg1Weld.C0=leg1Weld.C0*CFrame.new(0,-0.1,0)
  205. leg2Weld.C0=leg2Weld.C0*CFrame.new(0,-0.1,0)
  206. wait()
  207. end
  208. for i=1,5 do
  209. leg1Weld.C0=leg1Weld.C0*CFrame.new(0,0,0.1)
  210. leg2Weld.C0=leg2Weld.C0*CFrame.new(0,0,0.1)
  211. wait()
  212. end
  213. for i=1,10 do
  214. arm1Weld.C0=arm1Weld.C0*CFrame.new(-0.1,-0.1,0)
  215. arm2Weld.C0=arm2Weld.C0*CFrame.new(0.1,-0.1,0)
  216. torsoWeld.C0=torsoWeld.C0*CFrame.new(0,-0.1,0)
  217. char.Torso.Neck.C0=char.Torso.Neck.C0*CFrame.new(0,0,-0.1)
  218. wait()
  219. end
  220. for i=1,5 do
  221. arm1Weld.C0=arm1Weld.C0*CFrame.new(0.1,0,0)
  222. arm2Weld.C0=arm2Weld.C0*CFrame.new(-0.1,0,0)
  223. wait()
  224. end
  225. for i=1,5 do
  226. arm1Weld.C0=arm1Weld.C0*CFrame.fromEulerAnglesXYZ(-0.1,0,0)
  227. arm2Weld.C0=arm2Weld.C0*CFrame.fromEulerAnglesXYZ(-0.1,0,0)
  228. wait()
  229. end
  230. for i=1,10 do
  231. arm1Weld.C0=arm1Weld.C0*CFrame.new(0,-0.1,0)
  232. arm2Weld.C0=arm2Weld.C0*CFrame.new(0,-0.1,0)
  233. wait()
  234. end
  235. sit=true
  236. elseif sit==true and key=="u" then
  237. sit=false
  238. for i=1,16 do
  239. leg1Weld.C0=leg1Weld.C0*CFrame.fromEulerAnglesXYZ(-0.1,0,0)
  240. leg2Weld.C0=leg2Weld.C0*CFrame.fromEulerAnglesXYZ(-0.1,0,0)
  241. wait()
  242. end
  243. for i=1,5 do
  244. leg1Weld.C0=leg1Weld.C0*CFrame.new(0,0.1,0)
  245. leg2Weld.C0=leg2Weld.C0*CFrame.new(0,0.1,0)
  246. wait()
  247. end
  248. for i=1,5 do
  249. leg1Weld.C0=leg1Weld.C0*CFrame.new(0,0,0.1)
  250. leg2Weld.C0=leg2Weld.C0*CFrame.new(0,0,0.1)
  251. wait()
  252. end
  253. for i=1,10 do
  254. arm1Weld.C0=arm1Weld.C0*CFrame.new(0.1,0.1,0)
  255. arm2Weld.C0=arm2Weld.C0*CFrame.new(-0.1,0.1,0)
  256. torsoWeld.C0=torsoWeld.C0*CFrame.new(0,0.1,0)
  257. char.Torso.Neck.C0=char.Torso.Neck.C0*CFrame.new(0,0,0.1)
  258. wait()
  259. end
  260. for i=1,5 do
  261. arm1Weld.C0=arm1Weld.C0*CFrame.new(-0.1,0,0)
  262. arm2Weld.C0=arm2Weld.C0*CFrame.new(0.1,0,0)
  263. wait()
  264. end
  265. for i=1,5 do
  266. arm1Weld.C0=arm1Weld.C0*CFrame.fromEulerAnglesXYZ(0.1,0,0)
  267. arm2Weld.C0=arm2Weld.C0*CFrame.fromEulerAnglesXYZ(0.1,0,0)
  268. wait()
  269. end
  270. for i=1,10 do
  271. arm1Weld.C0=arm1Weld.C0*CFrame.new(0,0.1,0)
  272. arm2Weld.C0=arm2Weld.C0*CFrame.new(0,0.1,0)
  273. wait()
  274. end
  275. char.Humanoid.WalkSpeed=16
  276. char.Humanoid.JumpPower=50
  277. canAttack=true
  278. elseif canAttack==true and key=="p" then
  279. canAttack=false
  280. char.Humanoid.WalkSpeed=0
  281. char.Humanoid.JumpPower=0
  282. for i=1,3 do
  283. arm1Weld.C0=arm1Weld.C0*CFrame.fromEulerAnglesXYZ(0,0,-0.1)
  284. arm2Weld.C0=arm2Weld.C0*CFrame.fromEulerAnglesXYZ(0,0,0.1)
  285. wait()
  286. end
  287. for i=1,400 do
  288. arm1Weld.C0=arm1Weld.C0*CFrame.new(0,0.1,0)
  289. arm2Weld.C0=arm2Weld.C0*CFrame.new(0,0.1,0)
  290. leg1Weld.C0=leg1Weld.C0*CFrame.new(0,0.1,0)
  291. leg2Weld.C0=leg2Weld.C0*CFrame.new(0,0.1,0)
  292. torsoWeld.C0=torsoWeld.C0*CFrame.new(0,0.1,0)
  293. char.Torso.Neck.C0=char.Torso.Neck.C0*CFrame.new(0,0,0.1)
  294. end
  295. wait(4)
  296. for i=1,400 do
  297. arm1Weld.C0=arm1Weld.C0*CFrame.new(0,-0.1,0)
  298. arm2Weld.C0=arm2Weld.C0*CFrame.new(0,-0.1,0)
  299. leg1Weld.C0=leg1Weld.C0*CFrame.new(0,-0.1,0)
  300. leg2Weld.C0=leg2Weld.C0*CFrame.new(0,-0.1,0)
  301. torsoWeld.C0=torsoWeld.C0*CFrame.new(0,-0.1,0)
  302. char.Torso.Neck.C0=char.Torso.Neck.C0*CFrame.new(0,0,-0.1)
  303. end
  304. local explosion=Instance.new("Explosion")
  305. explosion.Parent=char
  306. explosion.BlastPressure=0
  307. explosion.Position=torso.Position
  308. explosion.Hit:connect(function(hit)
  309. if hit.Parent:FindFirstChild("Humanoid")~=nil and hit.Parent~=char then
  310. hit.Parent.Humanoid.Health=0
  311. end
  312. end)
  313. for i=1,3 do
  314. arm1Weld.C0=arm1Weld.C0*CFrame.fromEulerAnglesXYZ(0,0,0.1)
  315. arm2Weld.C0=arm2Weld.C0*CFrame.fromEulerAnglesXYZ(0,0,-0.1)
  316. wait()
  317. end
  318. char.Humanoid.WalkSpeed=16
  319. char.Humanoid.JumpPower=50
  320. canAttack=true
  321. end
  322. end)
  323. arm1.Touched:connect(function(hit)
  324. if hit.Parent:FindFirstChild("Humanoid")~=nil and hit.Parent~=char and damageArm1==true then
  325. hit.Parent.Humanoid.Health=hit.Parent.Humanoid.Health-10
  326. end
  327. end)
  328. arm2.Touched:connect(function(hit)
  329. if hit.Parent:FindFirstChild("Humanoid")~=nil and hit.Parent~=char and damageArm2==true then
  330. hit.Parent.Humanoid.Health=hit.Parent.Humanoid.Health-10
  331. end
  332. end)
  333. leg1.Touched:connect(function(hit)
  334. if hit.Parent:FindFirstChild("Humanoid")~=nil and hit.Parent~=char and damageLeg1==true then
  335. hit.Parent.Humanoid.Health=hit.Parent.Humanoid.Health-10
  336. end
  337. end)
  338. leg2.Touched:connect(function(hit)
  339. if hit.Parent:FindFirstChild("Humanoid")~=nil and hit.Parent~=char and damageLeg2==true then
  340. hit.Parent.Humanoid.Health=hit.Parent.Humanoid.Health-10
  341. end
  342. end)
  343. torso.Touched:connect(function(hit)
  344. if hit.Parent:FindFirstChild("Humanoid")~=nil and hit.Parent~=char and damageTorso==true then
  345. hit.Parent.Humanoid.Health=hit.Parent.Humanoid.Health-10
  346. end
  347. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement