TheProNoob2004

Ninja Suit.Lua

Jun 18th, 2016
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.82 KB | None | 0 0
  1. if script == nil then return end
  2.  
  3.  
  4. Player = game.Players:FindFirstChild("chrismash")
  5. controlActivated = false
  6. Button1Down = false
  7. swordUp = false
  8. swordSlash = false
  9. swordSlash2 = false
  10. swordLunge = false
  11. swordStab = false
  12. swordType = "normal"
  13.  
  14.  
  15. function makeParts()
  16. local suit = Instance.new("Model")
  17. suit.Name = "Suit"
  18. suit.Parent = Player.Character
  19. local p = Instance.new("Part")
  20. p.Name = "Torso Cover"
  21. p.FormFactor = "Custom"
  22. p.size = Vector3.new(2, 2, 1)
  23. p.BrickColor = BrickColor.new("Institutional white")
  24. p.Locked = true
  25. p.TopSurface = 0
  26. p.BottomSurface = 0
  27. p.Parent = suit
  28. local m = Instance.new("SpecialMesh")
  29. m.MeshType = "Torso"
  30. m.Scale = Vector3.new(0.75, 0.5, 1.1)
  31. m.Parent = p
  32. local w = Instance.new("Weld")
  33. w.Part0 = p
  34. w.Part1 = Player.Character:FindFirstChild("Torso")
  35. w.C0 = CFrame.new(0, 0.5, 0)
  36. w.C1 = CFrame.new()
  37. w.Parent = p
  38. local p = Instance.new("Part")
  39. p.Name = "Torso Cover"
  40. p.FormFactor = "Custom"
  41. p.size = Vector3.new(2, 2, 1)
  42. p.BrickColor = BrickColor.new("Really black")
  43. p.Locked = true
  44. p.TopSurface = 0
  45. p.BottomSurface = 0
  46. p.Parent = suit
  47. local m = Instance.new("SpecialMesh")
  48. m.MeshType = "Brick"
  49. m.Scale = Vector3.new(1.01, 1.01, 1.01)
  50. m.Parent = p
  51. local w = Instance.new("Weld")
  52. w.Part0 = p
  53. w.Part1 = Player.Character:FindFirstChild("Torso")
  54. w.C0 = CFrame.new(0, 0, 0)
  55. w.C1 = CFrame.new()
  56. w.Parent = p
  57. local p = Instance.new("Part")
  58. p.Name = "Left Arm Cover"
  59. p.FormFactor = "Custom"
  60. p.size = Vector3.new(1, 2, 1)
  61. p.BrickColor = BrickColor.new("Really black")
  62. p.Locked = true
  63. p.TopSurface = 0
  64. p.BottomSurface = 0
  65. p.Parent = suit
  66. local m = Instance.new("SpecialMesh")
  67. m.MeshType = "Brick"
  68. m.Scale = Vector3.new(1.01, 1.01, 1.01)
  69. m.Parent = p
  70. local w = Instance.new("Weld")
  71. w.Part0 = p
  72. w.Part1 = Player.Character:FindFirstChild("Left Arm")
  73. w.C0 = CFrame.new(0, 0, 0)
  74. w.C1 = CFrame.new()
  75. w.Parent = p
  76. local p = Instance.new("Part")
  77. p.Name = "Left Arm Cover"
  78. p.FormFactor = "Custom"
  79. p.size = Vector3.new(1, 2, 1)
  80. p.BrickColor = BrickColor.new("Institutional white")
  81. p.Locked = true
  82. p.TopSurface = 0
  83. p.BottomSurface = 0
  84. p.Parent = suit
  85. local m = Instance.new("SpecialMesh")
  86. m.MeshType = "Brick"
  87. m.Scale = Vector3.new(0.76, 1.02, 1.1)
  88. m.Parent = p
  89. local w = Instance.new("Weld")
  90. w.Part0 = p
  91. w.Part1 = Player.Character:FindFirstChild("Left Arm")
  92. w.C0 = CFrame.new(0.13, 0, 0)
  93. w.C1 = CFrame.new()
  94. w.Parent = p
  95. local p = Instance.new("Part")
  96. p.Name = "Right Arm Cover"
  97. p.FormFactor = "Custom"
  98. p.size = Vector3.new(1, 2, 1)
  99. p.BrickColor = BrickColor.new("Really black")
  100. p.Locked = true
  101. p.TopSurface = 0
  102. p.BottomSurface = 0
  103. p.Parent = suit
  104. local m = Instance.new("SpecialMesh")
  105. m.MeshType = "Brick"
  106. m.Scale = Vector3.new(1.01, 1.01, 1.01)
  107. m.Parent = p
  108. local w = Instance.new("Weld")
  109. w.Part0 = p
  110. w.Part1 = Player.Character:FindFirstChild("Right Arm")
  111. w.C0 = CFrame.new(0, 0, 0)
  112. w.C1 = CFrame.new()
  113. w.Parent = p
  114. local p = Instance.new("Part")
  115. p.Name = "Right Arm Cover"
  116. p.FormFactor = "Custom"
  117. p.size = Vector3.new(1, 2, 1)
  118. p.BrickColor = BrickColor.new("Institutional white")
  119. p.Locked = true
  120. p.TopSurface = 0
  121. p.BottomSurface = 0
  122. p.Parent = suit
  123. local m = Instance.new("SpecialMesh")
  124. m.MeshType = "Brick"
  125. m.Scale = Vector3.new(0.76, 1.02, 1.1)
  126. m.Parent = p
  127. local w = Instance.new("Weld")
  128. w.Part0 = p
  129. w.Part1 = Player.Character:FindFirstChild("Right Arm")
  130. w.C0 = CFrame.new(-0.13, 0, 0)
  131. w.C1 = CFrame.new()
  132. w.Parent = p
  133. local p = Instance.new("Part")
  134. p.Name = "Left Leg Cover"
  135. p.FormFactor = "Custom"
  136. p.size = Vector3.new(1, 2, 1)
  137. p.BrickColor = BrickColor.new("Really black")
  138. p.CanCollide = false
  139. p.Locked = true
  140. p.TopSurface = 0
  141. p.BottomSurface = 0
  142. p.Parent = suit
  143. local m = Instance.new("SpecialMesh")
  144. m.MeshType = "Brick"
  145. m.Scale = Vector3.new(1.01, 1.01, 1.01)
  146. m.Parent = p
  147. local w = Instance.new("Weld")
  148. w.Part0 = p
  149. w.Part1 = Player.Character:FindFirstChild("Left Leg")
  150. w.C0 = CFrame.new(0, 0, 0)
  151. w.C1 = CFrame.new()
  152. w.Parent = p
  153. local p = Instance.new("Part")
  154. p.Name = "Left Leg Cover"
  155. p.FormFactor = "Custom"
  156. p.size = Vector3.new(1, 2, 1)
  157. p.BrickColor = BrickColor.new("Institutional white")
  158. p.CanCollide = false
  159. p.Locked = true
  160. p.TopSurface = 0
  161. p.BottomSurface = 0
  162. p.Parent = suit
  163. local m = Instance.new("SpecialMesh")
  164. m.MeshType = "Brick"
  165. m.Scale = Vector3.new(0.76, 1.02, 1.1)
  166. m.Parent = p
  167. local w = Instance.new("Weld")
  168. w.Part0 = p
  169. w.Part1 = Player.Character:FindFirstChild("Left Leg")
  170. w.C0 = CFrame.new(-0.13, 0, 0)
  171. w.C1 = CFrame.new()
  172. w.Parent = p
  173. local p = Instance.new("Part")
  174. p.Name = "Right Leg Cover"
  175. p.FormFactor = "Custom"
  176. p.size = Vector3.new(1, 2, 1)
  177. p.BrickColor = BrickColor.new("Really black")
  178. p.CanCollide = false
  179. p.Locked = true
  180. p.TopSurface = 0
  181. p.BottomSurface = 0
  182. p.Parent = suit
  183. local m = Instance.new("SpecialMesh")
  184. m.MeshType = "Brick"
  185. m.Scale = Vector3.new(1.01, 1.01, 1.01)
  186. m.Parent = p
  187. local w = Instance.new("Weld")
  188. w.Part0 = p
  189. w.Part1 = Player.Character:FindFirstChild("Right Leg")
  190. w.C0 = CFrame.new(0, 0, 0)
  191. w.C1 = CFrame.new()
  192. w.Parent = p
  193. local p = Instance.new("Part")
  194. p.Name = "Right Leg Cover"
  195. p.FormFactor = "Custom"
  196. p.size = Vector3.new(1, 2, 1)
  197. p.BrickColor = BrickColor.new("Institutional white")
  198. p.Locked = true
  199. p.TopSurface = 0
  200. p.BottomSurface = 0
  201. p.Parent = suit
  202. local m = Instance.new("SpecialMesh")
  203. m.MeshType = "Brick"
  204. m.Scale = Vector3.new(0.76, 1.02, 1.1)
  205. m.Parent = p
  206. local w = Instance.new("Weld")
  207. w.Part0 = p
  208. w.Part1 = Player.Character:FindFirstChild("Right Leg")
  209. p.CanCollide = false
  210. w.C0 = CFrame.new(0.13, 0, 0)
  211. w.C1 = CFrame.new()
  212. w.Parent = p
  213. local p = Instance.new("Part")
  214. p.Name = "Head Cover"
  215. p.FormFactor = "Custom"
  216. p.size = Vector3.new(2, 1, 1)
  217. p.BrickColor = BrickColor.new("Institutional white")
  218. p.Locked = true
  219. p.TopSurface = 0
  220. p.BottomSurface = 0
  221. p.Parent = suit
  222. local m = Instance.new("SpecialMesh")
  223. m.MeshType = "Head"
  224. m.Scale = Vector3.new(1.5, 1.5, 1.5)
  225. m.Parent = p
  226. local w = Instance.new("Weld")
  227. w.Part0 = p
  228. w.Part1 = Player.Character:FindFirstChild("Head")
  229. w.C0 = CFrame.new(0, 0, 0)
  230. w.C1 = CFrame.new()
  231. w.Parent = p
  232. local p = Instance.new("Part")
  233. p.Name = "Glasses"
  234. p.FormFactor = "Custom"
  235. p.size = Vector3.new(1, 1, 1)
  236. p.BrickColor = BrickColor.new("Bright red")
  237. p.Locked = true
  238. p.TopSurface = 0
  239. p.BottomSurface = 0
  240. p.Parent = suit
  241. local m = Instance.new("SpecialMesh")
  242. m.MeshType = "Sphere"
  243. m.Scale = Vector3.new(1, 0.4, 0.9)
  244. m.Parent = p
  245. local w = Instance.new("Weld")
  246. w.Part0 = p
  247. w.Part1 = Player.Character:FindFirstChild("Head")
  248. w.C0 = CFrame.new(0, -0.25, 0.5)
  249. w.C1 = CFrame.new()
  250. w.Parent = p
  251. local sword1 = Instance.new("Model")
  252. sword1.Name = "LeftArmParts"
  253. sword1.Parent = suit
  254. local pm = Instance.new("Part")
  255. pm.Name = "Handle"
  256. pm.Size = Vector3.new(1, 1, 2)
  257. pm.BrickColor = BrickColor.new("Really black")
  258. pm.Locked = true
  259. pm.TopSurface = 0
  260. pm.BottomSurface = 0
  261. pm.Parent = sword1
  262. local m = Instance.new("SpecialMesh")
  263. m.MeshType = "Brick"
  264. m.Scale = Vector3.new(0.3, 0.4, 0.75)
  265. m.Parent = pm
  266. local w = Instance.new("Weld")
  267. w.Part0 = pm
  268. w.Part1 = Player.Character:FindFirstChild("Left Arm")
  269. w.C0 = CFrame.new(0, 1, 0.5)
  270. w.C1 = CFrame.new()
  271. w.Parent = pm
  272. local p = Instance.new("Part")
  273. p.Name = "Sword Guard"
  274. p.size = Vector3.new(1, 1, 1)
  275. p.BrickColor = BrickColor.new("Really black")
  276. p.Locked = true
  277. p.TopSurface = 0
  278. p.BottomSurface = 0
  279. p.Parent = sword1
  280. local m = Instance.new("SpecialMesh")
  281. m.MeshType = "Brick"
  282. m.Scale = Vector3.new(0.5, 0.6, 0.2)
  283. m.Parent = p
  284. local w = Instance.new("Weld")
  285. w.Part0 = p
  286. w.Part1 = pm
  287. w.C0 = CFrame.new(0, 0, 0.85)
  288. w.C1 = CFrame.new()
  289. w.Parent = p
  290. local p = Instance.new("Part")
  291. p.Name = "Sword Metal"
  292. p.size = Vector3.new(1, 1, 3)
  293. p.BrickColor = BrickColor.new("Institutional white")
  294. p.Locked = true
  295. p.Reflectance = 0.25
  296. p.CanCollide = false
  297. p.TopSurface = 0
  298. p.BottomSurface = 0
  299. p.Parent = sword1
  300. p.Touched:connect(function(hit) onTouched(hit, p, "sword") end)
  301. local m = Instance.new("SpecialMesh")
  302. m.MeshType = "Brick"
  303. m.Scale = Vector3.new(0.1, 0.4, 1)
  304. m.Parent = p
  305. local w = Instance.new("Weld")
  306. w.Part0 = p
  307. w.Part1 = pm
  308. w.C0 = CFrame.new(0, 0, 2.35)
  309. w.C1 = CFrame.new()
  310. w.Parent = p
  311. local p = Instance.new("Part")
  312. p.Name = "Sword Tip"
  313. p.size = Vector3.new(1, 1, 1)
  314. p.BrickColor = BrickColor.new("Institutional white")
  315. p.Locked = true
  316. p.Reflectance = 0.25
  317. p.CanCollide = false
  318. p.TopSurface = 0
  319. p.BottomSurface = 0
  320. p.Parent = sword1
  321. p.Touched:connect(function(hit) onTouched(hit, p, "sword") end)
  322. local m = Instance.new("SpecialMesh")
  323. m.MeshType = "Wedge"
  324. m.Scale = Vector3.new(0.1, 0.4, 0.5)
  325. m.Parent = p
  326. local w = Instance.new("Weld")
  327. w.Part0 = p
  328. w.Part1 = pm
  329. w.C0 = CFrame.new(0, 0, 4.1) * CFrame.fromEulerAnglesXYZ(0, 0, 3.14)
  330. w.C1 = CFrame.new()
  331. w.Parent = p
  332. local sword2 = Instance.new("Model")
  333. sword2.Name = "RightArmParts"
  334. sword2.Parent = suit
  335. local pm = Instance.new("Part")
  336. pm.Name = "Handle"
  337. pm.Size = Vector3.new(1, 1, 2)
  338. pm.BrickColor = BrickColor.new("Really black")
  339. pm.Locked = true
  340. pm.TopSurface = 0
  341. pm.BottomSurface = 0
  342. pm.Parent = sword2
  343. local m = Instance.new("SpecialMesh")
  344. m.MeshType = "Brick"
  345. m.Scale = Vector3.new(0.3, 0.4, 0.75)
  346. m.Parent = pm
  347. local w = Instance.new("Weld")
  348. w.Part0 = pm
  349. w.Part1 = Player.Character:FindFirstChild("Right Arm")
  350. w.C0 = CFrame.new(0, 1, 0.5)
  351. w.C1 = CFrame.new()
  352. w.Parent = pm
  353. local p = Instance.new("Part")
  354. p.Name = "Sword Guard"
  355. p.size = Vector3.new(1, 1, 1)
  356. p.BrickColor = BrickColor.new("Really black")
  357. p.Locked = true
  358. p.TopSurface = 0
  359. p.BottomSurface = 0
  360. p.Parent = sword2
  361. local m = Instance.new("SpecialMesh")
  362. m.MeshType = "Brick"
  363. m.Scale = Vector3.new(0.5, 0.6, 0.2)
  364. m.Parent = p
  365. local w = Instance.new("Weld")
  366. w.Part0 = p
  367. w.Part1 = pm
  368. w.C0 = CFrame.new(0, 0, 0.85)
  369. w.C1 = CFrame.new()
  370. w.Parent = p
  371. local p = Instance.new("Part")
  372. p.Name = "Sword Metal"
  373. p.size = Vector3.new(1, 1, 3)
  374. p.BrickColor = BrickColor.new("Institutional white")
  375. p.Locked = true
  376. p.Reflectance = 0.25
  377. p.CanCollide = false
  378. p.TopSurface = 0
  379. p.BottomSurface = 0
  380. p.Parent = sword2
  381. p.Touched:connect(function(hit) onTouched(hit, p, "sword") end)
  382. local m = Instance.new("SpecialMesh")
  383. m.MeshType = "Brick"
  384. m.Scale = Vector3.new(0.1, 0.4, 1)
  385. m.Parent = p
  386. local w = Instance.new("Weld")
  387. w.Part0 = p
  388. w.Part1 = pm
  389. w.C0 = CFrame.new(0, 0, 2.35)
  390. w.C1 = CFrame.new()
  391. w.Parent = p
  392. local p = Instance.new("Part")
  393. p.Name = "Sword Tip"
  394. p.size = Vector3.new(1, 1, 1)
  395. p.BrickColor = BrickColor.new("Institutional white")
  396. p.Locked = true
  397. p.Reflectance = 0.25
  398. p.CanCollide = false
  399. p.TopSurface = 0
  400. p.BottomSurface = 0
  401. p.Parent = sword2
  402. p.Touched:connect(function(hit) onTouched(hit, p, "sword") end)
  403. local m = Instance.new("SpecialMesh")
  404. m.MeshType = "Wedge"
  405. m.Scale = Vector3.new(0.1, 0.4, 0.5)
  406. m.Parent = p
  407. local w = Instance.new("Weld")
  408. w.Part0 = p
  409. w.Part1 = pm
  410. w.C0 = CFrame.new(0, 0, 4.1) * CFrame.fromEulerAnglesXYZ(0, 0, 3.14)
  411. w.C1 = CFrame.new()
  412. w.Parent = p
  413. Player.Character.Humanoid.WalkSpeed = 25
  414. end
  415.  
  416.  
  417. function removeParts()
  418. if Player.Character:FindFirstChild("Suit") ~= nil then
  419. Player.Character.Suit:Remove()
  420. end
  421. Player.Character.Humanoid.WalkSpeed = 16
  422. end
  423.  
  424.  
  425. function onDied()
  426. wait(4.9)
  427. if script.Parent.Parent == nil then return end
  428. script.Parent.Parent = nil
  429. wait(0.1)
  430. script.Parent = Player.Backpack
  431. Player.Character.Humanoid.Died:connect(onDied)
  432. end
  433.  
  434.  
  435. function SetAngle(Joint, Angle, Character)
  436. if Character == nil then return false end
  437. local Joints = {
  438. Character.Torso:FindFirstChild("Right Shoulder 2"),
  439. Character.Torso:FindFirstChild("Left Shoulder 2"),
  440. Character.Torso:FindFirstChild("Right Hip 2"),
  441. Character.Torso:FindFirstChild("Left Hip 2")
  442. }
  443. if Joints[Joint] == nil then return false end
  444. if Joint == 1 or Joint == 3 then
  445. Joints[Joint].DesiredAngle = Angle
  446. end
  447. if Joint == 2 or Joint == 4 then
  448. Joints[Joint].DesiredAngle = -Angle
  449. end
  450. end
  451.  
  452.  
  453. function ForceAngle(Joint, Angle, Character)
  454. if Character == nil then return false end
  455. local Joints = {
  456. Character.Torso:FindFirstChild("Right Shoulder 2"),
  457. Character.Torso:FindFirstChild("Left Shoulder 2"),
  458. Character.Torso:FindFirstChild("Right Hip 2"),
  459. Character.Torso:FindFirstChild("Left Hip 2")
  460. }
  461. if Joints[Joint] == nil then return false end
  462. if Joint == 1 or Joint == 3 then
  463. Joints[Joint].DesiredAngle = Angle
  464. Joints[Joint].CurrentAngle = Angle
  465. end
  466. if Joint == 2 or Joint == 4 then
  467. Joints[Joint].DesiredAngle = -Angle
  468. Joints[Joint].CurrentAngle = -Angle
  469. end
  470. end
  471.  
  472.  
  473. function SetSpeed(Joint, Speed, Character)
  474. if Character == nil then return false end
  475. local Joints = {
  476. Character.Torso:FindFirstChild("Right Shoulder 2"),
  477. Character.Torso:FindFirstChild("Left Shoulder 2"),
  478. Character.Torso:FindFirstChild("Right Hip 2"),
  479. Character.Torso:FindFirstChild("Left Hip 2")
  480. }
  481. if Joints[Joint] == nil then return false end
  482. Joints[Joint].MaxVelocity = Speed
  483. end
  484.  
  485.  
  486. function DisableLimb(Limb, Character)
  487. if Character == nil then return false end
  488. if Character:FindFirstChild("Torso") == nil then return false end
  489. local Joints = {
  490. Character.Torso:FindFirstChild("Right Shoulder"),
  491. Character.Torso:FindFirstChild("Left Shoulder"),
  492. Character.Torso:FindFirstChild("Right Hip"),
  493. Character.Torso:FindFirstChild("Left Hip")
  494. }
  495. local Limbs = {
  496. Character:FindFirstChild("Right Arm"),
  497. Character:FindFirstChild("Left Arm"),
  498. Character:FindFirstChild("Right Leg"),
  499. Character:FindFirstChild("Left Leg")
  500. }
  501. if Joints[Limb] == nil then return false end
  502. if Limbs[Limb] == nil then return false end
  503. local Joint = Instance.new("Motor")
  504. Joint.Parent = Character.Torso
  505. Joint.Part0 = Character.Torso
  506. Joint.Part1 = Limbs[Limb]
  507. if Limb == 1 then
  508. Joint.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  509. Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  510. Joint.Name = "Right Shoulder 2"
  511. elseif Limb == 2 then
  512. Joint.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  513. Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  514. Joint.Name = "Left Shoulder 2"
  515. elseif Limb == 3 then
  516. Joint.C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  517. Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  518. Joint.Name = "Right Hip 2"
  519. elseif Limb == 4 then
  520. Joint.C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  521. Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  522. Joint.Name = "Left Hip 2"
  523. end
  524. Joint.MaxVelocity = Joints[Limb].MaxVelocity
  525. Joint.CurrentAngle = Joints[Limb].CurrentAngle
  526. Joint.DesiredAngle = Joints[Limb].DesiredAngle
  527. Joints[Limb]:Remove()
  528. end
  529.  
  530.  
  531. function ResetLimbCFrame(Limb, Character)
  532. if Character == nil then return false end
  533. if Character.Parent == nil then return false end
  534. if Character:FindFirstChild("Torso") == nil then return false end
  535. local Joints = {
  536. Character.Torso:FindFirstChild("Right Shoulder 2"),
  537. Character.Torso:FindFirstChild("Left Shoulder 2"),
  538. Character.Torso:FindFirstChild("Right Hip 2"),
  539. Character.Torso:FindFirstChild("Left Hip 2")
  540. }
  541. local Limbs = {
  542. Character:FindFirstChild("Right Arm"),
  543. Character:FindFirstChild("Left Arm"),
  544. Character:FindFirstChild("Right Leg"),
  545. Character:FindFirstChild("Left Leg")
  546. }
  547. if Joints[Limb] == nil then return false end
  548. if Limbs[Limb] == nil then return false end
  549. if Limb == 1 then
  550. Joints[Limb].C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  551. Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  552. elseif Limb == 2 then
  553. Joints[Limb].C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  554. Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  555. elseif Limb == 3 then
  556. Joints[Limb].C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  557. Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  558. elseif Limb == 4 then
  559. Joints[Limb].C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  560. Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  561. end
  562. end
  563.  
  564.  
  565. function EnableLimb(Limb, Character)
  566. if Character == nil then return false end
  567. if Character:FindFirstChild("Torso") == nil then return false end
  568. local Joints = {
  569. Character.Torso:FindFirstChild("Right Shoulder 2"),
  570. Character.Torso:FindFirstChild("Left Shoulder 2"),
  571. Character.Torso:FindFirstChild("Right Hip 2"),
  572. Character.Torso:FindFirstChild("Left Hip 2")
  573. }
  574. local Limbs = {
  575. Character:FindFirstChild("Right Arm"),
  576. Character:FindFirstChild("Left Arm"),
  577. Character:FindFirstChild("Right Leg"),
  578. Character:FindFirstChild("Left Leg")
  579. }
  580. if Joints[Limb] == nil then return false end
  581. if Limbs[Limb] == nil then return false end
  582. if Limb == 1 then
  583. Joints[Limb].Name = "Right Shoulder"
  584. elseif Limb == 2 then
  585. Joints[Limb].Name = "Left Shoulder"
  586. elseif Limb == 3 then
  587. Joints[Limb].Name = "Right Hip"
  588. elseif Limb == 4 then
  589. Joints[Limb].Name = "Left Hip"
  590. end
  591. Animate = Character:FindFirstChild("Animate")
  592. if Animate == nil then return false end
  593. Animate = Animate:Clone()
  594. Character.Animate:Remove()
  595. Animate.Parent = Character
  596. end
  597.  
  598.  
  599. function Weld(x, y)
  600. weld = Instance.new("Weld")
  601. weld.Part0 = x
  602. weld.Part1 = y
  603. CJ = CFrame.new(x.Position)
  604. C0 = x.CFrame:inverse() * CJ
  605. C1 = y.CFrame:inverse() * CJ
  606. weld.C0 = C0
  607. weld.C1 = C1
  608. weld.Parent = x
  609. end
  610.  
  611.  
  612. function onTouched(hit, source, format)
  613. if hit.Parent == Player.Character or hit.Parent == Player.Character.Suit or hit.Parent == Player.Character.Suit.LeftArmParts or hit.Parent == Player.Character.Suit.RightArmParts then return end
  614. if format == "sword" then
  615. if hit.Parent:FindFirstChild("Humanoid") ~= nil and hit.Parent ~= Player.Character then
  616. tagHumanoid(hit.Parent.Humanoid)
  617. if swordType == "normal" then
  618. hit.Parent.Humanoid:TakeDamage(1)
  619. elseif swordType == "slash" then
  620. hit.Parent.Humanoid:TakeDamage(10)
  621. elseif swordType == "lunge" then
  622. hit.Parent.Humanoid:TakeDamage(10)
  623. hit.Parent.Humanoid.Sit = true
  624. elseif swordType == "stab" then
  625. if Player.Character == nil then return false end
  626. if Player.Character:FindFirstChild("Suit") == nil then return false end
  627. if Player.Character.Suit:FindFirstChild("LeftArmParts") == nil then return false end
  628. if Player.Character.Suit.LeftArmParts:FindFirstChild("Sword Metal") == nil then return false end
  629. hit.Parent.Humanoid.PlatformStand = true
  630. Weld(hit, source)
  631. while hit.Parent.Humanoid ~= nil do
  632. hit.Parent.Humanoid:TakeDamage(1)
  633. wait(0.1)
  634. end
  635. end
  636. delay(3, function() untagHumanoid(hit.Parent.Humanoid) end)
  637. end
  638. end
  639. end
  640.  
  641.  
  642. loadstring(game:GetService("InsertService"):LoadAsset(65363615)["tagHumanoid"].Value)()
  643.  
  644.  
  645. function onButton1Down(mouse)
  646. if controlActivated == false then return end
  647. mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
  648. Button1Down = true
  649. if swordUp == true and swordSlash == false and swordLunge == false and swordStab == false then
  650. local s = Instance.new("Sound")
  651. s.SoundId = "rbxasset://sounds\\swordslash.wav"
  652. s.PlayOnRemove = true
  653. s.Parent = Player.Character.Torso
  654. s:Remove()
  655. swordSlash = true
  656. swordType = "slash"
  657. SetSpeed(2, 0.5, Player.Character)
  658. SetAngle(2, 0, Player.Character)
  659. delay(0.2, function() if swordLunge ~= true then SetAngle(2, 3.14 / 2, Player.Character) swordType = "normal" end end)
  660. delay(0.3, function() if swordLunge ~= true then SetSpeed(2, 0.1, Player.Character) swordSlash = false end end)
  661. elseif swordUp == true and swordSlash == true and swordLunge == false and swordStab == false then
  662. local s = Instance.new("Sound")
  663. s.SoundId = "rbxasset://sounds\\swordlunge.wav"
  664. s.PlayOnRemove = true
  665. s.Parent = Player.Character.Torso
  666. s:Remove()
  667. swordSlash = false
  668. swordSlash2 = false
  669. swordLunge = true
  670. swordType = "lunge"
  671. SetSpeed(1, 0.5, Player.Character)
  672. SetAngle(1, 3.14 / 2, Player.Character)
  673. SetSpeed(2, 0.5, Player.Character)
  674. SetAngle(2, 3.14 / 2, Player.Character)
  675. if Player.Character.Suit.LeftArmParts:FindFirstChild("Handle") ~= nil then
  676. if Player.Character.Suit.LeftArmParts.Handle:FindFirstChild("Weld") ~= nil then
  677. OldWeldLeft = Player.Character.Suit.LeftArmParts.Handle.Weld.C0
  678. Player.Character.Suit.LeftArmParts.Handle.Weld.C0 = CFrame.new(0, 0, 1) * CFrame.fromEulerAnglesXYZ(3.14 / 2, 0, 0)
  679. end
  680. end
  681. if Player.Character.Suit.RightArmParts:FindFirstChild("Handle") ~= nil then
  682. if Player.Character.Suit.RightArmParts.Handle:FindFirstChild("Weld") ~= nil then
  683. OldWeldRight = Player.Character.Suit.RightArmParts.Handle.Weld.C0
  684. Player.Character.Suit.RightArmParts.Handle.Weld.C0 = CFrame.new(0, 0, 1) * CFrame.fromEulerAnglesXYZ(3.14 / 2, 0, 0)
  685. end
  686. end
  687. Player.Character.Torso.Velocity = Player.Character.Torso.Velocity + ((Player.Character.Torso.CFrame.lookVector * 100) + Vector3.new(0, 10, 0))
  688. wait(1)
  689. SetAngle(1, 3.14 / 2, Player.Character)
  690. SetSpeed(1, 0.3, Player.Character)
  691. SetAngle(2, 3.14 / 2, Player.Character)
  692. SetSpeed(2, 0.3, Player.Character)
  693. SetAngle(3, 3.14 / 2, Player.Character)
  694. SetSpeed(3, 0.3, Player.Character)
  695. SetAngle(4, 3.14 / 2, Player.Character)
  696. SetSpeed(4, 0.3, Player.Character)
  697. swordType = "normal"
  698. if Player.Character.Suit.LeftArmParts:FindFirstChild("Handle") ~= nil then
  699. if Player.Character.Suit.LeftArmParts.Handle:FindFirstChild("Weld") ~= nil then
  700. Player.Character.Suit.LeftArmParts.Handle.Weld.C0 = OldWeldLeft
  701. end
  702. end
  703. if Player.Character.Suit.RightArmParts:FindFirstChild("Handle") ~= nil then
  704. if Player.Character.Suit.RightArmParts.Handle:FindFirstChild("Weld") ~= nil then
  705. Player.Character.Suit.RightArmParts.Handle.Weld.C0 = OldWeldRight
  706. end
  707. end
  708. wait(0.25)
  709. SetSpeed(1, 0.1, Player.Character)
  710. SetSpeed(2, 0.1, Player.Character)
  711. swordLunge = false
  712. end
  713. end
  714.  
  715.  
  716. function onButton1Up(mouse)
  717. Button1Down = false
  718. if swordUp == true and swordSlash2 == false and swordLunge == false and swordStab == false then
  719. local s = Instance.new("Sound")
  720. s.SoundId = "rbxasset://sounds\\swordslash.wav"
  721. s.PlayOnRemove = true
  722. s.Parent = Player.Character.Torso
  723. s:Remove()
  724. swordSlash2 = true
  725. swordType = "slash"
  726. SetSpeed(1, 0.5, Player.Character)
  727. SetAngle(1, 0, Player.Character)
  728. delay(0.2, function() if swordLunge ~= true then SetAngle(1, 3.14 / 2, Player.Character) swordType = "normal" end end)
  729. delay(0.3, function() if swordLunge ~= true then SetSpeed(1, 0.1, Player.Character) swordSlash2 = false end end)
  730. end
  731. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  732. end
  733.  
  734.  
  735. function onKeyDown(key, mouse)
  736. key = key:lower()
  737. if key == "q" then
  738. if controlActivated == false then
  739. if Player.Character ~= nil then
  740. if Player.Character:FindFirstChild("Suit") == nil then
  741. makeParts()
  742. controlActivated = true
  743. local s = Instance.new("Sound")
  744. s.SoundId = "rbxasset://sounds\\unsheath.wav"
  745. s.Pitch = 1.1
  746. s.PlayOnRemove = true
  747. s.Parent = Player.Character.Torso
  748. s:Remove()
  749. end
  750. end
  751. elseif controlActivated == true then
  752. if Player.Character ~= nil then
  753. if swordSlash == false and swordLunge == false and swordStab == false then
  754. removeParts()
  755. ResetLimbCFrame(1, Player.Character)
  756. ResetLimbCFrame(2, Player.Character)
  757. controlActivated = false
  758. local s = Instance.new("Sound")
  759. s.SoundId = "rbxasset://sounds\\unsheath.wav"
  760. s.Pitch = 0.9
  761. s.PlayOnRemove = true
  762. s.Parent = Player.Character.Torso
  763. s:Remove()
  764. EnableLimb(1, Player.Character)
  765. EnableLimb(2, Player.Character)
  766. EnableLimb(3, Player.Character)
  767. EnableLimb(4, Player.Character)
  768. swordUp = false
  769. end
  770. end
  771. end
  772. end
  773. if key == "z" then
  774. onDeselected(mouse)
  775. removeParts()
  776. mouse.Icon = ""
  777. script.Parent:Remove()
  778. end
  779. if controlActivated ~= true then return end
  780. if key == "f" then
  781. if swordSlash == false and swordSlash2 == false and swordLunge == false and swordStab == false and swordUp == false then
  782. DisableLimb(1, Player.Character)
  783. DisableLimb(2, Player.Character)
  784. SetAngle(1, 3.14 / 2, Player.Character)
  785. SetAngle(2, 3.14 / 2, Player.Character)
  786. swordUp = true
  787. elseif swordSlash == false and swordSlash2 == false and swordLunge == false and swordStab == false and swordUp == true then
  788. SetAngle(1, 0, Player.Character)
  789. SetAngle(2, 0, Player.Character)
  790. EnableLimb(1, Player.Character)
  791. EnableLimb(2, Player.Character)
  792. swordUp = false
  793. end
  794. end
  795. if key == "g" then
  796. if swordSlash == false and swordLunge == false and swordStab == false then
  797. swordStab = true
  798. if swordUp == false then
  799. DisableLimb(1, Player.Character)
  800. DisableLimb(2, Player.Character)
  801. end
  802. local s = Instance.new("Sound")
  803. s.SoundId = "rbxasset://sounds\\swordslash.wav"
  804. s.Pitch = 0.75
  805. s.PlayOnRemove = true
  806. s.Parent = Player.Character.Torso
  807. s:Remove()
  808. SetSpeed(1, 0.5, Player.Character)
  809. SetAngle(1, 0, Player.Character)
  810. SetSpeed(2, 0.5, Player.Character)
  811. SetAngle(2, 0, Player.Character)
  812. wait(0.25)
  813. swordType = "stab"
  814. SetSpeed(1, 0.5, Player.Character)
  815. SetAngle(1, 3.14, Player.Character)
  816. SetSpeed(2, 0.5, Player.Character)
  817. SetAngle(2, 3.14, Player.Character)
  818. wait(0.5)
  819. SetSpeed(1, 0.1, Player.Character)
  820. SetAngle(1, 3.14 / 1.5, Player.Character)
  821. SetSpeed(2, 0.1, Player.Character)
  822. SetAngle(2, 3.14 / 1.5, Player.Character)
  823. swordType = "normal"
  824. swordStab = false
  825. end
  826. end
  827. if key == "x" then
  828. if Player.Character ~= nil then
  829. if Player.Character:FindFirstChild("Torso") ~= nil then
  830. Player.Character.Torso.CFrame = CFrame.new(mouse.Hit.p + Vector3.new(0, 2.75, 0))
  831. end
  832. end
  833. end
  834. end
  835.  
  836.  
  837. function onSelected(mouse)
  838. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  839. mouse.Button1Down:connect(function() onButton1Down(mouse) end)
  840. mouse.Button1Up:connect(function() onButton1Up(mouse) end)
  841. mouse.KeyDown:connect(function(key) onKeyDown(key, mouse) end)
  842. end
  843.  
  844.  
  845. function onDeselected(mouse)
  846. --To do
  847. end
  848.  
  849.  
  850. if script.Parent.ClassName ~= "HopperBin" then
  851. if Player == nil then print("Error: Player not found!") return end
  852. Tool = Instance.new("HopperBin")
  853. Tool.Name = "Suit Control"
  854. Tool.Parent = Player.Backpack
  855. script.Name = "Main"
  856. script.Parent = Tool
  857. Player.Character.Humanoid.Died:connect(onDied)
  858. elseif script.Parent.ClassName == "HopperBin" then
  859. Player = script.Parent.Parent.Parent
  860. script.Parent.Selected:connect(onSelected)
  861. script.Parent.Deselected:connect(onDeselected)
  862. end
Add Comment
Please, Sign In to add comment