Advertisement
minecrafter523

Black Katana

Jun 1st, 2016
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 96.04 KB | None | 0 0
  1. if script == nil then return end
  2.  
  3. if not script:findFirstChild("Player") then
  4. oPlayer = Instance.new("ObjectValue")
  5. oPlayer.Parent = script
  6. oPlayer.Name = "Player"
  7. end
  8.  
  9. ModelName = "Black Katana"
  10. if script.Name ~= "PlaySound" then
  11. PlayerName = "xNeonDragonz" ------------------------------------------------------ YOUR NAME HERE --------
  12. end
  13. if PlayerName ~= nil then
  14. Player = game.Players:findFirstChild(PlayerName)
  15. end
  16. Selected = false
  17. Connected = false
  18. Button1Down = false
  19. CanUse = true
  20. Damage = 0
  21.  
  22. if script.Parent.className == "HopperBin" then
  23. script.Parent.Name = "BlackKatana"
  24. script.Name = "Main"
  25. if not script:findFirstChild("Debugger") then
  26. Debugger = game:GetService("InsertService"):LoadAsset(54430469)
  27. Debugger.Parent = script
  28. end
  29. if Debugger ~= nil then
  30. if Debugger.Name ~= "Debugger" then
  31. if Debugger.className == "Model" then
  32. if Debugger:findFirstChild("Debugger") then
  33. if Debugger.Debugger.className == "Script" then
  34. Debugger.Debugger.Parent = script
  35. Debugger:remove()
  36. if script:findFirstChild("Debugger") then
  37. if script.Debugger.className == "Script" then
  38. script.Debugger.Disabled = true
  39. script.Debugger.Disabled = false
  40. if not script:findFirstChild("InHopperBin") then
  41. local InHopperBin = Instance.new("ObjectValue")
  42. InHopperBin.Parent = script
  43. InHopperBin.Name = "InHopperBin"
  44. end end end end end end end end end
  45. if script.Parent.className ~= "HopperBin" then
  46. if script.Parent.Name ~= "BlackKatana" then
  47. if not script:findFirstChild("InHopperBin") then
  48. HB = Instance.new("HopperBin")
  49. HB.Parent = game.Players:findFirstChild(PlayerName).Backpack
  50. HB.Name = "BlackKatana"
  51. cloneScript = script:clone()
  52. cloneScript.Parent = HB
  53. cloneScript.Name = "Main"
  54. local InHopperBin = Instance.new("ObjectValue")
  55. InHopperBin.Parent = cloneScript
  56. InHopperBin.Name = "InHopperBin"
  57. script:remove()
  58. end end end
  59.  
  60. function SetSwordDamage(DamageNew, Time)
  61. if DamageDefault == nil then
  62. DamageDefault = Damage
  63. end
  64. if DamageNew == "Default" then
  65. Damage = DamageDefault
  66. elseif type(DamageNew) == "number" then
  67. Damage = DamageNew
  68. end
  69. if Time ~= nil then
  70. coroutine.wrap(function()
  71. local DamageResetDefault = time()
  72. DamageReset = DamageResetDefault
  73. wait(Time)
  74. if DamageReset == DamageResetDefault then
  75. Damage = DamageDefault
  76. end
  77. end)()
  78. end
  79. end
  80.  
  81.  
  82. function CheckPlayer()
  83. if Player.Character == nil then return false end
  84. if Player.Character:FindFirstChild("Torso") == nil or Player.Character:FindFirstChild("Right Arm") == nil or Player.Character:FindFirstChild("Humanoid") == nil then return false end
  85. if Player.Character.Humanoid.Health <= 0 then return false end
  86. return true
  87. end
  88.  
  89.  
  90. function PlaySound(Name, SoundId, Pitch, Volume, Looped, Parent)
  91. local NewScript = script:Clone()
  92. NewScript.Name = "PlaySound"
  93. local SoundData = Instance.new("Model", NewScript)
  94. SoundData.Name = "SoundData"
  95. Instance.new("StringValue", SoundData).Name = "_Name"
  96. SoundData._Name.Value = Name
  97. Instance.new("StringValue", SoundData).Name = "_SoundId"
  98. SoundData._SoundId.Value = SoundId
  99. Instance.new("NumberValue", SoundData).Name = "_Pitch"
  100. SoundData._Pitch.Value = Pitch
  101. Instance.new("NumberValue", SoundData).Name = "_Volume"
  102. SoundData._Volume.Value = Volume
  103. Instance.new("BoolValue", SoundData).Name = "_Looped"
  104. SoundData._Looped.Value = Looped
  105. Instance.new("ObjectValue", SoundData).Name = "_Parent"
  106. SoundData._Parent.Value = Parent
  107. NewScript.Disabled = true
  108. NewScript.Parent = game:GetService("Workspace")
  109. coroutine.wrap(function()
  110. wait(0.05)
  111. NewScript.Disabled = false
  112. end)()
  113. end
  114.  
  115.  
  116. function SetPartDamage(Damage, Break, Parent)
  117. pcall(function() Parent.PartDamage:Remove() end)
  118. local NewScript = script:Clone()
  119. NewScript.Name = "PartDamage"
  120. local DamageData = Instance.new("Model", NewScript)
  121. DamageData.Name = "DamageData"
  122. Instance.new("NumberValue", DamageData).Name = "Damage"
  123. DamageData.Damage.Value = Damage
  124. Instance.new("BoolValue", DamageData).Name = "Break"
  125. DamageData.Break.Value = Break
  126. NewScript.Disabled = true
  127. NewScript.Parent = Parent
  128. coroutine.wrap(function()
  129. wait(0.05)
  130. NewScript.Disabled = false
  131. end)()
  132. end
  133.  
  134.  
  135. function CreateParts(Parent, Format)
  136. if Parent == nil then return end
  137. local Parts = Instance.new("Model")
  138. Parts.Name = ModelName
  139. if Format == 1 then
  140. Parts.Name = Parts.Name.. " (Holstered)"
  141. end
  142. Parts.Parent = Parent
  143.  
  144. local MasterPart1 = Instance.new("Part")
  145. MasterPart1.Name = "Sheath"
  146. MasterPart1.BrickColor = BrickColor.new("Really black")
  147. MasterPart1.TopSurface = 0
  148. MasterPart1.BottomSurface = 0
  149. MasterPart1.formFactor = "Custom"
  150. MasterPart1.Size = Vector3.new(0.25, 0.5, 3.5)
  151. MasterPart1.Locked = true
  152. MasterPart1.Parent = Parts
  153. local Weld = Instance.new("Weld")
  154. Weld.Part0 = MasterPart1
  155. Weld.Part1 = Player.Character:FindFirstChild("Torso")
  156. Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(150), 0, 0)
  157. Weld.C1 = CFrame.new(-1.1, -1.75, 0.5)
  158. Weld.Parent = Weld.Part0
  159.  
  160. local MasterPart2 = Instance.new("Part")
  161. MasterPart2.Name = "Handle"
  162. MasterPart2.BrickColor = BrickColor.new("Really black")
  163. MasterPart2.TopSurface = 0
  164. MasterPart2.BottomSurface = 0
  165. MasterPart2.formFactor = "Custom"
  166. MasterPart2.Size = Vector3.new(0.3, 0.4, 1.25)
  167. MasterPart2.Locked = true
  168. MasterPart2.Parent = Parts
  169. local Weld = Instance.new("Weld")
  170. Weld.Part0 = MasterPart2
  171. if Format == 1 then
  172. Weld.Part1 = MasterPart1
  173. Weld.C1 = CFrame.new(0, 0, 2.625)
  174. elseif Format == 2 then
  175. Weld.Part1 = Player.Character:FindFirstChild("Right Arm")
  176. Weld.C1 = CFrame.new(0, -1, -0.1)
  177. end
  178. Weld.Parent = Weld.Part0
  179. local Part = Instance.new("Part")
  180. Part.Name = "Hand Guard"
  181. Part.BrickColor = BrickColor.new("Really black")
  182. Part.TopSurface = 0
  183. Part.BottomSurface = 0
  184. Part.formFactor = "Custom"
  185. Part.Size = Vector3.new(0.5, 0.6, 0.25)
  186. Part.Locked = true
  187. Part.Parent = Parts
  188. local Weld = Instance.new("Weld")
  189. Weld.Part0 = Part
  190. Weld.Part1 = MasterPart2
  191. Weld.C0 = CFrame.new(0, 0, 0.75)
  192. Weld.Parent = Weld.Part0
  193. local Part = Instance.new("Part")
  194. Part.Name = "Blade Holder"
  195. Part.BrickColor = BrickColor.new("Really black")
  196. Part.TopSurface = 0
  197. Part.BottomSurface = 0
  198. Part.formFactor = "Custom"
  199. Part.Size = Vector3.new(0.25, 0.375, 0.2)
  200. Part.Locked = true
  201. Part.Parent = Parts
  202. local Weld = Instance.new("Weld")
  203. Weld.Part0 = Part
  204. Weld.Part1 = MasterPart2
  205. Weld.C0 = CFrame.new(0, 0, 0.9)
  206. Weld.Parent = Weld.Part0
  207. local Mesh = Instance.new("SpecialMesh", Part)
  208. Mesh.MeshType = "Brick"
  209. Mesh.Scale = Vector3.new(1, 1, 0.25)
  210. local Part = Instance.new("Part")
  211. Part.Name = "Blade"
  212. Part.BrickColor = BrickColor.new("Light stone grey")
  213. Part.Reflectance = 0.25
  214. Part.TopSurface = 0
  215. Part.BottomSurface = 0
  216. Part.formFactor = "Custom"
  217. Part.Size = Vector3.new(0.2, 0.3, 2.75)
  218. Part.Locked = true
  219. Part.Parent = Parts
  220. Part.Touched:connect(SwordTouched)
  221. local Weld = Instance.new("Weld")
  222. Weld.Part0 = Part
  223. Weld.Part1 = MasterPart2
  224. Weld.C0 = CFrame.new(0, 0, 2.25)
  225. Weld.Parent = Weld.Part0
  226. local Mesh = Instance.new("SpecialMesh", Part)
  227. Mesh.MeshType = "Brick"
  228. Mesh.Scale = Vector3.new(0.1, 1, 1)
  229. local Part = Instance.new("WedgePart")
  230. Part.Name = "Blade Tip"
  231. Part.BrickColor = BrickColor.new("Light stone grey")
  232. Part.Reflectance = 0.25
  233. Part.TopSurface = 0
  234. Part.BottomSurface = 0
  235. Part.formFactor = "Custom"
  236. Part.Size = Vector3.new(0.2, 0.3, 0.75)
  237. Part.Locked = true
  238. Part.Parent = Parts
  239. Part.Touched:connect(SwordTouched)
  240. local Weld = Instance.new("Weld")
  241. Weld.Part0 = Part
  242. Weld.Part1 = MasterPart2
  243. Weld.C0 = CFrame.new(0, 0, 4) * CFrame.fromEulerAnglesXYZ(0, 0, math.rad(180))
  244. Weld.Parent = Weld.Part0
  245. local Mesh = Instance.new("SpecialMesh", Part)
  246. Mesh.MeshType = "Wedge"
  247. Mesh.Scale = Vector3.new(0.1, 1, 1)
  248. end
  249.  
  250.  
  251. function RemoveParts(Parent, Format)
  252. if Format == 1 then
  253. pcall(function() Parent[ModelName.. " (Holstered)"]:Remove() end)
  254. elseif Format == 2 then
  255. pcall(function() Parent[ModelName]:Remove() end)
  256. end
  257. end
  258.  
  259.  
  260. function SetAngle(Joint, Angle, Character)
  261. if Character == nil then return false end
  262. local Joints = {
  263. Character.Torso:FindFirstChild("Right Shoulder 2"),
  264. Character.Torso:FindFirstChild("Left Shoulder 2"),
  265. Character.Torso:FindFirstChild("Right Hip 2"),
  266. Character.Torso:FindFirstChild("Left Hip 2")
  267. }
  268. if Joints[Joint] == nil then return false end
  269. if Joint == 1 or Joint == 3 then
  270. Joints[Joint].DesiredAngle = Angle
  271. end
  272. if Joint == 2 or Joint == 4 then
  273. Joints[Joint].DesiredAngle = -Angle
  274. end
  275. end
  276.  
  277.  
  278. function ForceAngle(Joint, Angle, Character)
  279. if Character == nil then return false end
  280. local Joints = {
  281. Character.Torso:FindFirstChild("Right Shoulder 2"),
  282. Character.Torso:FindFirstChild("Left Shoulder 2"),
  283. Character.Torso:FindFirstChild("Right Hip 2"),
  284. Character.Torso:FindFirstChild("Left Hip 2")
  285. }
  286. if Joints[Joint] == nil then return false end
  287. if Joint == 1 or Joint == 3 then
  288. Joints[Joint].DesiredAngle = Angle
  289. Joints[Joint].CurrentAngle = Angle
  290. end
  291. if Joint == 2 or Joint == 4 then
  292. Joints[Joint].DesiredAngle = -Angle
  293. Joints[Joint].CurrentAngle = -Angle
  294. end
  295. end
  296.  
  297.  
  298. function SetSpeed(Joint, Speed, Character)
  299. if Character == nil then return false end
  300. local Joints = {
  301. Character.Torso:FindFirstChild("Right Shoulder 2"),
  302. Character.Torso:FindFirstChild("Left Shoulder 2"),
  303. Character.Torso:FindFirstChild("Right Hip 2"),
  304. Character.Torso:FindFirstChild("Left Hip 2")
  305. }
  306. if Joints[Joint] == nil then return false end
  307. Joints[Joint].MaxVelocity = Speed
  308. end
  309.  
  310.  
  311. function DisableLimb(Limb, Character)
  312. if Character == nil then return false end
  313. if Character:FindFirstChild("Torso") == nil then return false end
  314. local Joints = {
  315. Character.Torso:FindFirstChild("Right Shoulder"),
  316. Character.Torso:FindFirstChild("Left Shoulder"),
  317. Character.Torso:FindFirstChild("Right Hip"),
  318. Character.Torso:FindFirstChild("Left Hip")
  319. }
  320. local Limbs = {
  321. Character:FindFirstChild("Right Arm"),
  322. Character:FindFirstChild("Left Arm"),
  323. Character:FindFirstChild("Right Leg"),
  324. Character:FindFirstChild("Left Leg")
  325. }
  326. if Joints[Limb] == nil then return false end
  327. if Limbs[Limb] == nil then return false end
  328. local Joint = Instance.new("Motor")
  329. Joint.Parent = Character.Torso
  330. Joint.Part0 = Character.Torso
  331. Joint.Part1 = Limbs[Limb]
  332. if Limb == 1 then
  333. Joint.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  334. Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  335. Joint.Name = "Right Shoulder 2"
  336. elseif Limb == 2 then
  337. Joint.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  338. Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  339. Joint.Name = "Left Shoulder 2"
  340. elseif Limb == 3 then
  341. Joint.C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  342. Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  343. Joint.Name = "Right Hip 2"
  344. elseif Limb == 4 then
  345. Joint.C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  346. Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  347. Joint.Name = "Left Hip 2"
  348. end
  349. Joint.MaxVelocity = Joints[Limb].MaxVelocity
  350. Joint.CurrentAngle = Joints[Limb].CurrentAngle
  351. Joint.DesiredAngle = Joints[Limb].DesiredAngle
  352. Joints[Limb]:Remove()
  353. end
  354.  
  355.  
  356. function ResetLimbCFrame(Limb, Character)
  357. if Character == nil then return false end
  358. if Character.Parent == nil then return false end
  359. if Character:FindFirstChild("Torso") == nil then return false end
  360. local Joints = {
  361. Character.Torso:FindFirstChild("Right Shoulder 2"),
  362. Character.Torso:FindFirstChild("Left Shoulder 2"),
  363. Character.Torso:FindFirstChild("Right Hip 2"),
  364. Character.Torso:FindFirstChild("Left Hip 2")
  365. }
  366. local Limbs = {
  367. Character:FindFirstChild("Right Arm"),
  368. Character:FindFirstChild("Left Arm"),
  369. Character:FindFirstChild("Right Leg"),
  370. Character:FindFirstChild("Left Leg")
  371. }
  372. if Joints[Limb] == nil then return false end
  373. if Limbs[Limb] == nil then return false end
  374. if Limb == 1 then
  375. Joints[Limb].C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  376. Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  377. elseif Limb == 2 then
  378. Joints[Limb].C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  379. Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  380. elseif Limb == 3 then
  381. Joints[Limb].C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  382. Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  383. elseif Limb == 4 then
  384. Joints[Limb].C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  385. Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  386. end
  387. end
  388.  
  389.  
  390. function EnableLimb(Limb, Character)
  391. if Character == nil then return false end
  392. if Character:FindFirstChild("Torso") == nil then return false end
  393. local Joints = {
  394. Character.Torso:FindFirstChild("Right Shoulder 2"),
  395. Character.Torso:FindFirstChild("Left Shoulder 2"),
  396. Character.Torso:FindFirstChild("Right Hip 2"),
  397. Character.Torso:FindFirstChild("Left Hip 2")
  398. }
  399. local Limbs = {
  400. Character:FindFirstChild("Right Arm"),
  401. Character:FindFirstChild("Left Arm"),
  402. Character:FindFirstChild("Right Leg"),
  403. Character:FindFirstChild("Left Leg")
  404. }
  405. if Joints[Limb] == nil then return false end
  406. if Limbs[Limb] == nil then return false end
  407. if Limb == 1 then
  408. Joints[Limb].Name = "Right Shoulder"
  409. elseif Limb == 2 then
  410. Joints[Limb].Name = "Left Shoulder"
  411. elseif Limb == 3 then
  412. Joints[Limb].Name = "Right Hip"
  413. elseif Limb == 4 then
  414. Joints[Limb].Name = "Left Hip"
  415. end
  416. Animate = Character:FindFirstChild("Animate")
  417. if Animate == nil then return false end
  418. Animate = Animate:Clone()
  419. Character.Animate:Remove()
  420. Animate.Parent = Character
  421. end
  422.  
  423.  
  424. function Weld(x, y)
  425. weld = Instance.new("Weld")
  426. weld.Part0 = x
  427. weld.Part1 = y
  428. CJ = CFrame.new(x.Position)
  429. C0 = x.CFrame:inverse() * CJ
  430. C1 = y.CFrame:inverse() * CJ
  431. weld.C0 = C0
  432. weld.C1 = C1
  433. weld.Parent = x
  434. end
  435.  
  436.  
  437. function SwordTouched(Hit)
  438. if Hit:IsDescendantOf(Player.Character) then return end
  439. if Hit.Parent:FindFirstChild("Humanoid") ~= nil then
  440. tagHumanoid(Hit.Parent.Humanoid)
  441. Hit.Parent.Humanoid:TakeDamage(Damage)
  442. wait()
  443. pcall(function() untagHumanoid(hit.Parent.Humanoid) end)
  444. end
  445. end
  446.  
  447.  
  448. function tagHumanoid(humanoid)
  449. local tag = Instance.new("ObjectValue")
  450. tag.Name = "creator"
  451. tag.Value = Player
  452. tag.Parent = humanoid
  453. end
  454.  
  455.  
  456. function untagHumanoid(humanoid)
  457. if humanoid ~= nil then
  458. local tag = humanoid:findFirstChild("creator")
  459. if tag ~= nil then
  460. tag:Remove()
  461. end
  462. end
  463. end
  464.  
  465.  
  466. function onButton1Down(Mouse)
  467. if Button1Down == true then return end
  468. Button1Down = true
  469. if CheckPlayer() == false then return end
  470. if KeyUGrab == true and KeyUGrabCharacter ~= nil and KeyUChoke ~= true and KeyUSlit ~= true then
  471. KeyUChoke = true
  472. for i = 0, 1, 0.1 do
  473. pcall(function()
  474. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1, 0.5, -0.75) * CFrame.fromEulerAnglesXYZ(math.rad(10 * i), math.rad(110 + (25 * i)), 0)
  475. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new(-1, 0.5, -0.75) * CFrame.fromEulerAnglesXYZ(math.rad(10 * i), math.rad(-110 - (25 * i)), 0)
  476. end)
  477. wait()
  478. end
  479. pcall(function()
  480. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1, 0.5, -0.75) * CFrame.fromEulerAnglesXYZ(math.rad(10), math.rad(135), 0)
  481. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new(-1, 0.5, -0.75) * CFrame.fromEulerAnglesXYZ(math.rad(10), math.rad(-135), 0)
  482. end)
  483. while Button1Down == true and KeyUGrab == true and Selected == true do
  484. if KeyUGrabCharacter.Humanoid.Health - 0.5 <= 0 and KeyUGrabCharacter:FindFirstChild("Head") ~= nil then
  485. pcall(function() KeyUWeld:Remove() end)
  486. for _, Part in pairs(KeyUGrabCharacter.Head:GetChildren()) do
  487. pcall(function()
  488. Part.SoundId = ""
  489. Part.Volume = 0
  490. Part.Pitch = 0
  491. end)
  492. end
  493. wait(0.1)
  494. KeyUGrabCharacter.Humanoid.Health = 0
  495. else
  496. KeyUGrabCharacter.Humanoid:TakeDamage(0.5)
  497. end
  498. if math.random(1, 20) == 1 then
  499. local BillboardGui = Instance.new("BillboardGui")
  500. BillboardGui.Parent = KeyUGrabCharacter
  501. BillboardGui.Adornee = KeyUGrabCharacter:FindFirstChild("Head")
  502. BillboardGui.Size = UDim2.new(1, 0, 1, 0)
  503. BillboardGui.StudsOffset = Vector3.new(0, 0.5, 0)
  504. local TextLabel = Instance.new("TextLabel")
  505. TextLabel.Parent = BillboardGui
  506. TextLabel.Position = UDim2.new(0, 0, 0, 0)
  507. TextLabel.Size = UDim2.new(1, 0, 1, 0)
  508. TextLabel.Text = (function()
  509. local Choice1 = math.random(1, 5)
  510. if Choice1 == 1 then
  511. Choice1 = "Hrk"
  512. elseif Choice1 == 2 then
  513. Choice1 = "Hk"
  514. elseif Choice1 == 3 then
  515. Choice1 = "Gak"
  516. elseif Choice1 == 4 then
  517. Choice1 = "Mmph"
  518. elseif Choice1 == 5 then
  519. Choice1 = "Mph"
  520. end
  521. local Choice2 = math.random(1, 5)
  522. if Choice2 == 1 then
  523. Choice2 = "!"
  524. elseif Choice2 == 2 then
  525. Choice2 = "?"
  526. elseif Choice2 == 3 then
  527. Choice2 = "..."
  528. elseif Choice2 == 4 then
  529. Choice2 = "-"
  530. elseif Choice2 == 5 then
  531. Choice2 = "!?"
  532. elseif Choice2 == 5 then
  533. Choice2 = "?!"
  534. end
  535. return Choice1 .. Choice2
  536. end)()
  537. TextLabel.FontSize = "Size14"
  538. TextLabel.TextColor3 = Color3.new(math.random(0, 255) / 255, 0, 0)
  539. TextLabel.BackgroundTransparency = 1
  540. coroutine.wrap(function()
  541. local Direction = Vector3.new(math.random(-75, 75) / 1000, math.random(-75, 75) / 1000, math.random(-75, 75) / 1000)
  542. for i = 0, math.random(25, 100) do
  543. BillboardGui.StudsOffset = BillboardGui.StudsOffset + Direction
  544. wait()
  545. end
  546. for i = 0, 1, 0.05 do
  547. BillboardGui.StudsOffset = BillboardGui.StudsOffset + (Direction * (1 - i)) - Vector3.new(0, 0.5 * i, 0)
  548. TextLabel.TextTransparency = i
  549. wait()
  550. end
  551. BillboardGui:Remove()
  552. end)()
  553. end
  554. wait()
  555. end
  556. for i = 0, 1, 0.1 do
  557. pcall(function()
  558. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1, 0.5, -0.75) * CFrame.fromEulerAnglesXYZ(math.rad(10 * (1 - i)), math.rad(135 - (25 * i)), 0)
  559. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new(-1, 0.5, -0.75) * CFrame.fromEulerAnglesXYZ(math.rad(10 * (1 - i)), math.rad(-135 + (25 * i)), 0)
  560. end)
  561. wait()
  562. end
  563. pcall(function()
  564. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1, 0.5, -0.75) * CFrame.fromEulerAnglesXYZ(0, math.rad(110), 0)
  565. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new(-1, 0.5, -0.75) * CFrame.fromEulerAnglesXYZ(0, math.rad(-110), 0)
  566. end)
  567. KeyUChoke = false
  568. elseif KeyUChoke == true and KeyUSlit ~= true then
  569. KeyUSlit = true
  570. while KeyUChoke == true do wait() end
  571. for i = 0, 1, 0.25 do
  572. pcall(function()
  573. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1 + (0.5 * i), 0.5, -0.75 + (0.75 * i)) * CFrame.fromEulerAnglesXYZ(0, math.rad(110 - (100 * i)), 0)
  574. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new(-1, 0.5, -0.75) * CFrame.fromEulerAnglesXYZ(0, math.rad(-110 + (50 * i)), 0)
  575. end)
  576. wait()
  577. end
  578. pcall(function() KeyUWeld:Remove() end)
  579. KeyUGrabCharacter.Humanoid.Health = 0
  580. wait(1)
  581. KeyUSlit = false
  582. CanUse = true
  583. elseif CanUse == true then
  584. CanUse = false
  585. PlaySound("Slash", "rbxasset://sounds\\swordslash.wav", math.random(150, 175) / 100, 1, false, Player.Character[ModelName].Blade)
  586. SetSwordDamage(2)
  587. SetSpeed(1, 0.75, Player.Character)
  588. SetAngle(1, math.rad(125), Player.Character)
  589. wait(0.15)
  590. SetSwordDamage(10, 0.2)
  591. SetSpeed(1, 1, Player.Character)
  592. SetAngle(1, math.rad(-10), Player.Character)
  593. wait(0.15)
  594. SetSpeed(1, 0.5, Player.Character)
  595. SetAngle(1, math.rad(90), Player.Character)
  596. wait(0.05)
  597. CanUse = true
  598. end
  599. end
  600.  
  601.  
  602. function onButton1Up(Mouse)
  603. Button1Down = false
  604. Mouse.Icon = "rbxasset://textures\\GunCursor.png"
  605. end
  606.  
  607.  
  608. function onKeyDown(Key, Mouse)
  609. if Selected == false then return end
  610. Key = Key:lower()
  611. if Key == "u" then
  612. if KeyUGrab == true then
  613. KeyUGrab = false
  614. end
  615. end
  616. if Button1Down == false and CanUse == true and CheckPlayer() == true then
  617. if Key == "q" then
  618. if Mouse.Target == nil then return end
  619. if CheckPlayer() == false then return end
  620. local NewPlayer = game:GetService("Players"):GetPlayerFromCharacter(Mouse.Target.Parent)
  621. if NewPlayer == nil then return end
  622. if NewPlayer.Character == nil then return end
  623. if NewPlayer.Character:FindFirstChild("Torso") == nil then return end
  624. if (NewPlayer.Character.Torso.CFrame.p - Player.Character.Torso.CFrame.p).magnitude > 10 then return end
  625. onDeselected(Mouse)
  626. wait()
  627. RemoveParts(Player.Character, 1)
  628. script.Parent.Parent = NewPlayer.Backpack
  629. Player = NewPlayer
  630. end
  631. if Key == "e" then
  632. CanUse = false
  633. local OldWalkSpeed = Player.Character.Humanoid.WalkSpeed
  634. local Direction = Player.Character.Torso.CFrame.lookVector
  635. Player.Character.Humanoid.WalkSpeed = 0
  636. DisableLimb(2, Player.Character)
  637. DisableLimb(3, Player.Character)
  638. DisableLimb(4, Player.Character)
  639. SetSpeed(1, 0.2, Player.Character)
  640. SetSpeed(2, 0.2, Player.Character)
  641. SetSpeed(3, 0.05, Player.Character)
  642. SetSpeed(4, 0.05, Player.Character)
  643. SetAngle(1, math.rad(90), Player.Character)
  644. SetAngle(2, math.rad(90), Player.Character)
  645. SetAngle(3, math.rad(35), Player.Character)
  646. SetAngle(4, math.rad(-35), Player.Character)
  647. for i = 0, 1, 0.075 do
  648. pcall(function()
  649. Player.Character[ModelName].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(90 * i), math.rad(180 * i), 0)
  650. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90 * (1 - i)), 0)
  651. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90 * (1 - i)), 0)
  652. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90 * (1 - i)), 0)
  653. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90 * (1 - i)), 0)
  654. end)
  655. wait()
  656. end
  657. pcall(function()
  658. Player.Character[ModelName].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(90), math.rad(180 * i), 0)
  659. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1.5, 0.5, 0)
  660. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(0, 0.5, 0)
  661. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new(-1.5, 0.5, 0)
  662. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(0, 0.5, 0)
  663. end)
  664. SetSwordDamage(10, 2.5)
  665. local BodyVelocity = Instance.new("BodyVelocity")
  666. BodyVelocity.maxForce = Vector3.new(math.huge, 0, math.huge)
  667. BodyVelocity.velocity = Direction * (OldWalkSpeed * 1.5)
  668. BodyVelocity.Parent = Player.Character.Torso
  669. local BodyAngularVelocity = Instance.new("BodyAngularVelocity")
  670. BodyAngularVelocity.maxTorque = Vector3.new(0, math.huge, 0)
  671. BodyAngularVelocity.angularvelocity = Vector3.new(0, 37.5, 0)
  672. BodyAngularVelocity.Parent = Player.Character.Torso
  673. for i = 0, 1, 0.01 do
  674. PlaySound("Slash", "rbxasset://sounds\\swordslash.wav", math.random(125, 200) / 100, 1, false, Player.Character[ModelName].Blade)
  675. local Wave = Instance.new("Part")
  676. Wave.Name = "Wave"
  677. Wave.BrickColor = BrickColor.new("Light stone grey")
  678. Wave.TopSurface = 0
  679. Wave.BottomSurface = 0
  680. Wave.Transparency = math.cos(i * math.pi * 1.85)
  681. Wave.Transparency = Wave.Transparency < 0.4 and 0.4 or Wave.Transparency
  682. Wave.Anchored = true
  683. Wave.CanCollide = false
  684. Wave.formFactor = "Custom"
  685. Wave.Size = Vector3.new(math.random(12, 15), 1, math.random(13, 16))
  686. Wave.CFrame = Player.Character.Torso.CFrame * CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(math.rad(math.random(-5, 5)), 0, math.rad(math.random(-5, 5)))
  687. Wave.Parent = game:GetService("Workspace")
  688. local Mesh = Instance.new("CylinderMesh", Wave)
  689. local Size = math.random(14, 16)
  690. Mesh.Scale = Vector3.new(1, 0.075, 1)
  691. coroutine.wrap(function()
  692. for i = Wave.Transparency, 1, 0.1 do
  693. Wave.Transparency = i
  694. wait()
  695. end
  696. Wave:Remove()
  697. end)()
  698. wait()
  699. end
  700. for i = 1, 25 do
  701. BodyVelocity.velocity = BodyVelocity.velocity / 1.2
  702. BodyAngularVelocity.angularvelocity = BodyAngularVelocity.angularvelocity / 1.075
  703. wait()
  704. end
  705. BodyVelocity:Remove()
  706. BodyAngularVelocity:Remove()
  707. SetAngle(2, 0, Player.Character)
  708. SetAngle(3, 0, Player.Character)
  709. SetAngle(4, 0, Player.Character)
  710. for i = 1, 0, -0.075 do
  711. pcall(function()
  712. Player.Character[ModelName].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(90 * i), math.rad(180 * i), 0)
  713. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90 * (1 - i)), 0)
  714. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90 * (1 - i)), 0)
  715. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90 * (1 - i)), 0)
  716. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90 * (1 - i)), 0)
  717. end)
  718. wait()
  719. end
  720. pcall(function()
  721. Player.Character[ModelName].Handle.Weld.C0 = CFrame.new()
  722. end)
  723. ResetLimbCFrame(1, Player.Character)
  724. ResetLimbCFrame(2, Player.Character)
  725. ResetLimbCFrame(3, Player.Character)
  726. ResetLimbCFrame(4, Player.Character)
  727. SetSpeed(1, 0.5, Player.Character)
  728. SetSpeed(2, 0.5, Player.Character)
  729. SetSpeed(3, 0.1, Player.Character)
  730. SetSpeed(4, 0.1, Player.Character)
  731. EnableLimb(1, Player.Character)
  732. EnableLimb(2, Player.Character)
  733. EnableLimb(3, Player.Character)
  734. EnableLimb(4, Player.Character)
  735. DisableLimb(1, Player.Character)
  736. Player.Character.Humanoid.WalkSpeed = OldWalkSpeed
  737. CanUse = true
  738. end
  739. if Key == "r" then
  740. CanUse = false
  741. local OldWalkSpeed = Player.Character.Humanoid.WalkSpeed
  742. local Direction = Player.Character.Torso.CFrame.lookVector
  743. Player.Character.Humanoid.WalkSpeed = 0
  744. DisableLimb(2, Player.Character)
  745. DisableLimb(3, Player.Character)
  746. DisableLimb(4, Player.Character)
  747. SetSpeed(1, 0.1, Player.Character)
  748. SetSpeed(2, 0.1, Player.Character)
  749. SetSpeed(3, 0.075, Player.Character)
  750. SetSpeed(4, 0.075, Player.Character)
  751. SetAngle(1, math.rad(90), Player.Character)
  752. SetAngle(2, math.rad(-45), Player.Character)
  753. SetAngle(3, math.rad(90), Player.Character)
  754. SetAngle(4, math.rad(-60), Player.Character)
  755. PlaySound("Slash", "rbxasset://sounds\\swordslash.wav", math.random(75, 100) / 100, 1, false, Player.Character[ModelName].Blade)
  756. for i = 0, 1, 0.075 do
  757. pcall(function()
  758. Player.Character[ModelName].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(90 * i), 0, 0)
  759. end)
  760. wait()
  761. end
  762. pcall(function()
  763. Player.Character[ModelName].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(90), 0, 0)
  764. end)
  765. SetSwordDamage(20, 1)
  766. local BodyVelocity = Instance.new("BodyVelocity")
  767. BodyVelocity.maxForce = Vector3.new(math.huge, 0, math.huge)
  768. BodyVelocity.velocity = Direction * (OldWalkSpeed * 5)
  769. BodyVelocity.Parent = Player.Character.Torso
  770. for i = 1, 20 do
  771. BodyVelocity.velocity = BodyVelocity.velocity / 1.15
  772. wait()
  773. end
  774. BodyVelocity:Remove()
  775. SetAngle(2, 0, Player.Character)
  776. SetAngle(3, 0, Player.Character)
  777. SetAngle(4, 0, Player.Character)
  778. for i = 1, 0, -0.1 do
  779. pcall(function()
  780. Player.Character[ModelName].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(90 * i), 0, 0)
  781. end)
  782. wait()
  783. end
  784. pcall(function()
  785. Player.Character[ModelName].Handle.Weld.C0 = CFrame.new()
  786. end)
  787. SetSpeed(1, 0.5, Player.Character)
  788. SetSpeed(2, 0.5, Player.Character)
  789. SetSpeed(3, 0.1, Player.Character)
  790. SetSpeed(4, 0.1, Player.Character)
  791. EnableLimb(1, Player.Character)
  792. EnableLimb(2, Player.Character)
  793. EnableLimb(3, Player.Character)
  794. EnableLimb(4, Player.Character)
  795. DisableLimb(1, Player.Character)
  796. Player.Character.Humanoid.WalkSpeed = OldWalkSpeed
  797. CanUse = true
  798. end
  799. if Key == "t" then
  800. CanUse = false
  801. KeyTDown = true
  802. local KeyTCharge = 0
  803. local KeyTFire = false
  804. local OldWalkSpeed = Player.Character.Humanoid.WalkSpeed
  805. Player.Character.Humanoid.WalkSpeed = OldWalkSpeed / 10
  806. for i = 0, 1, 0.1 do
  807. pcall(function()
  808. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90 - (100 * i)), 0)
  809. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90 + (90 * i)), 0)
  810. Player.Character[ModelName].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(90 * i), 0, 0)
  811. end)
  812. wait()
  813. end
  814. pcall(function()
  815. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-10), 0)
  816. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(180), 0)
  817. Player.Character[ModelName].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(90), 0, 0)
  818. end)
  819. while KeyTDown == true and Mouse ~= nil and Selected == true do
  820. KeyTCharge = KeyTCharge + 1
  821. if KeyTCharge >= 35 then
  822. KeyTFire = true
  823. local Shock = Instance.new("Part", game:GetService("Workspace"))
  824. Shock.Name = "Shock Ring"
  825. Shock.BrickColor = BrickColor.new("Bright red")
  826. Shock.Transparency = 0.5
  827. Shock.Anchored = true
  828. Shock.CanCollide = false
  829. Shock.formFactor = "Custom"
  830. Shock.Size = Vector3.new(1.5, 1, 1.5)
  831. Shock.CFrame = Player.Character["Right Arm"].CFrame * CFrame.new(0, -1.5, 0.125) * CFrame.fromEulerAnglesXYZ(math.rad(180 + math.random(-25, 25)), 0, math.rad(math.random(-25, 25)))
  832. local Mesh = Instance.new("SpecialMesh", Shock)
  833. Mesh.MeshType = "FileMesh"
  834. Mesh.MeshId = "http://www.roblox.com/asset/?id=20329976"
  835. Mesh.Scale = Shock.Size
  836. coroutine.wrap(function()
  837. wait()
  838. for i = Shock.Transparency, 1, 0.05 do
  839. Shock.Transparency = i
  840. Shock.CFrame = Shock.CFrame * CFrame.new(0, 0.5, 0)
  841. wait()
  842. end
  843. Shock:Remove()
  844. end)()
  845. end
  846. wait()
  847. end
  848. PlaySound("Slash", "rbxasset://sounds\\swordslash.wav", math.random(125, 150) / 100, 1, false, Player.Character[ModelName].Blade)
  849. wait(0.05)
  850. SetSwordDamage(0, 0)
  851. local _, Position = pcall(function() return Mouse.Hit.p end)
  852. for i = 0, 1, KeyTFire == true and 0.1 or 0.2 do
  853. pcall(function()
  854. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-10 + (170 * i)), 0)
  855. Player.Character[ModelName].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(90 + (10 * i)), 0, 0)
  856. end)
  857. if KeyTFire == true and type(Position) == "userdata" then
  858. local Shock = Instance.new("Part", game:GetService("Workspace"))
  859. Shock.Name = "Shock Ring"
  860. Shock.BrickColor = BrickColor.new("Bright red")
  861. Shock.TopSurface = 0
  862. Shock.BottomSurface = 0
  863. Shock.Anchored = true
  864. Shock.CanCollide = false
  865. Shock.formFactor = "Custom"
  866. Shock.Size = Vector3.new(0.2, 0.2, 0.2)
  867. Shock.CFrame = CFrame.new(Player.Character[ModelName].Blade.CFrame.p, Position) * CFrame.fromEulerAnglesXYZ(math.rad(-90), 0, math.rad(math.sin((i + 1.5) * math.pi) * 25))
  868. coroutine.wrap(function()
  869. wait()
  870. for i = 0, 1, 0.05 do
  871. Shock.Transparency = i
  872. local NewPosition = Shock.CFrame * CFrame.new(0, 3, 0)
  873. Shock.Size = Shock.Size + Vector3.new(0.75, 0.5, 0.05)
  874. Shock.CFrame = NewPosition
  875. wait()
  876. end
  877. Shock:Remove()
  878. end)()
  879. SetPartDamage(0, false, Shock)
  880. end
  881. wait()
  882. end
  883. pcall(function()
  884. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(160), 0)
  885. Player.Character[ModelName].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(100), 0, 0)
  886. end)
  887. for i = 0, 1, 0.1 do
  888. pcall(function()
  889. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(160 - (70 * i)), 0)
  890. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(180 - (90 * i)), 0)
  891. Player.Character[ModelName].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(100 * (1 - i)), 0, 0)
  892. end)
  893. wait()
  894. end
  895. pcall(function()
  896. Player.Character[ModelName].Handle.Weld.C0 = CFrame.new()
  897. end)
  898. ResetLimbCFrame(1, Player.Character)
  899. Player.Character.Humanoid.WalkSpeed = OldWalkSpeed
  900. CanUse = true
  901. end
  902. if Key == "y" then
  903. CanUse = false
  904. KeyYDown = true
  905. local OldWalkSpeed = Player.Character.Humanoid.WalkSpeed
  906. Player.Character.Humanoid.WalkSpeed = OldWalkSpeed / 5
  907. for i = 0, 1, 0.25 do
  908. pcall(function()
  909. Player.Character[ModelName].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(90 * i), 0, 0)
  910. end)
  911. wait()
  912. end
  913. pcall(function()
  914. Player.Character[ModelName].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(90), 0, 0)
  915. end)
  916. for _, Part in pairs(Player.Character[ModelName]:GetChildren()) do
  917. if Part.Name ~= "Sheath" then
  918. pcall(function() Part.Transparency = 1 end)
  919. end
  920. end
  921. SetSwordDamage(10)
  922. while KeyYDown == true and Mouse ~= nil and Selected == true do
  923. PlaySound("Slash", "rbxasset://sounds\\swordslash.wav", math.random(150, 175) / 100, 1, false, Player.Character[ModelName].Blade)
  924. pcall(function()
  925. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1.5, 0.5, 0)
  926. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-90 + math.random(-30, 30)), math.rad(math.random(-30, 30)), 0)
  927. end)
  928. local Ghost = Instance.new("Part", game:GetService("Workspace"))
  929. Ghost.Name = "Ghost"
  930. Ghost.BrickColor = BrickColor.new("Industrial white")
  931. Ghost.Anchored = true
  932. Ghost.CanCollide = false
  933. Ghost.formFactor = "Custom"
  934. Ghost.Size = Vector3.new(0.2, 0.2, 4)
  935. Ghost.CFrame = Player.Character[ModelName].Handle.CFrame * CFrame.fromEulerAnglesXYZ(math.rad(math.random(-25, 25)), math.rad(math.random(-25, 25)), 0) * CFrame.new(math.random(-100, 100) / 100, math.random(-100, 100) / 100, math.random(-4, -3))
  936. local Mesh = Instance.new("SpecialMesh", Ghost)
  937. Mesh.MeshType = "Sphere"
  938. coroutine.wrap(function()
  939. wait()
  940. for i = 0, 1, 0.1 do
  941. Ghost.Transparency = i
  942. wait()
  943. end
  944. Ghost:Remove()
  945. end)()
  946. wait()
  947. end
  948. ResetLimbCFrame(1, Player.Character)
  949. SetSwordDamage(0)
  950. for _, Part in pairs(Player.Character[ModelName]:GetChildren()) do
  951. if Part.Name ~= "Sheath" then
  952. pcall(function() Part.Transparency = 0 end)
  953. end
  954. end
  955. for i = 0, 1, 0.1 do
  956. pcall(function()
  957. Player.Character[ModelName].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(100 * (1 - i)), 0, 0)
  958. end)
  959. wait()
  960. end
  961. pcall(function()
  962. Player.Character[ModelName].Handle.Weld.C0 = CFrame.new()
  963. end)
  964. Player.Character.Humanoid.WalkSpeed = OldWalkSpeed
  965. CanUse = true
  966. end
  967. if Key == "u" then
  968. if KeyUGrab ~= true then
  969. if Player.Character.Torso:FindFirstChild("IsGrabbed") ~= nil then return end
  970. if Mouse.Target == nil then return end
  971. KeyUGrabCharacter = Mouse.Target.Parent
  972. if KeyUGrabCharacter == nil then return end
  973. if KeyUGrabCharacter:FindFirstChild("Torso") == nil or KeyUGrabCharacter:FindFirstChild("Head") == nil or KeyUGrabCharacter:FindFirstChild("Humanoid") == nil then return end
  974. if KeyUGrabCharacter.Torso:FindFirstChild("IsGrabbed") ~= nil then return end
  975. if (KeyUGrabCharacter.Torso.CFrame.p - Player.Character.Torso.CFrame.p).magnitude > 5 then return end
  976. CanUse = false
  977. KeyUGrab = true
  978. local Marker1 = Instance.new("IntValue", KeyUGrabCharacter.Torso)
  979. Marker1.Name = "IsGrabbed"
  980. KeyUWeld = Instance.new("Weld", Player.Character.Torso)
  981. KeyUWeld.Name = "IsGrabbed"
  982. KeyUWeld.Part0 = KeyUWeld.Parent
  983. KeyUWeld.Part1 = KeyUGrabCharacter.Torso
  984. KeyUWeld.C0 = CFrame.new(0, 0, -1.05)
  985. DisableLimb(2, Player.Character)
  986. SetSpeed(1, 0.2, Player.Character)
  987. SetSpeed(2, 0.2, Player.Character)
  988. SetAngle(1, math.rad(100), Player.Character)
  989. SetAngle(2, math.rad(100), Player.Character)
  990. for i = 0, 1, 0.1 do
  991. pcall(function()
  992. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1.5 - (0.5 * i), 0.5, -0.75 * i) * CFrame.fromEulerAnglesXYZ(0, math.rad(90 + (20 * i)), 0)
  993. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new(-1.5 + (0.5 * i), 0.5, -0.75 * i) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90 - (20 * i)), 0)
  994. Player.Character[ModelName].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(160 * i), math.rad(110 * i), 0)
  995. end)
  996. wait()
  997. end
  998. pcall(function()
  999. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1, 0.5, -0.75) * CFrame.fromEulerAnglesXYZ(0, math.rad(110), 0)
  1000. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new(-1, 0.5, -0.75) * CFrame.fromEulerAnglesXYZ(0, math.rad(-110), 0)
  1001. Player.Character[ModelName].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(160), math.rad(110), 0)
  1002. end)
  1003. while KeyUGrab == true and Selected == true do
  1004. if CheckPlayer() == false then break end
  1005. if KeyUWeld.Parent == nil then break end
  1006. if KeyUGrabCharacter == nil then break end
  1007. if KeyUGrabCharacter:FindFirstChild("Torso") == nil or KeyUGrabCharacter:FindFirstChild("Humanoid") == nil then break end
  1008. if KeyUGrabCharacter.Humanoid.Health <= 0 then break end
  1009. KeyUGrabCharacter.Humanoid.PlatformStand = true
  1010. wait()
  1011. end
  1012. KeyUGrab = false
  1013. while KeyUChoke == true do wait() end
  1014. pcall(function() KeyUWeld:Remove() end)
  1015. pcall(function() Marker1:Remove() end)
  1016. pcall(function() Marker2:Remove() end)
  1017. pcall(function() KeyUGrabCharacter.Humanoid.Sit = true end)
  1018. if KeyUSlit == true then
  1019. while KeyUSlit == true do wait() end
  1020. SetSpeed(1, 0.5, Player.Character)
  1021. SetSpeed(2, 0.5, Player.Character)
  1022. SetAngle(1, math.rad(90), Player.Character)
  1023. SetAngle(2, 0, Player.Character)
  1024. for i = 0, 1, 0.1 do
  1025. pcall(function()
  1026. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(10 + (80 * i)), 0)
  1027. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new(-1 - (0.5 * i), 0.5, -0.75 + 0.75) * CFrame.fromEulerAnglesXYZ(0, math.rad(-10 - (80 * i)), 0)
  1028. Player.Character[ModelName].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(160 * (1 - i)), math.rad(110 * (1 - i)), 0)
  1029. end)
  1030. wait()
  1031. end
  1032. else
  1033. SetSpeed(1, 0.5, Player.Character)
  1034. SetSpeed(2, 0.5, Player.Character)
  1035. SetAngle(1, math.rad(90), Player.Character)
  1036. SetAngle(2, 0, Player.Character)
  1037. for i = 1, 0, -0.1 do
  1038. pcall(function()
  1039. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1.5 - (0.5 * i), 0.5, -0.75 * i) * CFrame.fromEulerAnglesXYZ(0, math.rad(90 + (20 * i)), 0)
  1040. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new(-1.5 + (0.5 * i), 0.5, -0.75 * i) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90 - (20 * i)), 0)
  1041. Player.Character[ModelName].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(160 * i), math.rad(110 * i), 0)
  1042. end)
  1043. wait()
  1044. end
  1045. end
  1046. ResetLimbCFrame(1, Player.Character)
  1047. ResetLimbCFrame(2, Player.Character)
  1048. Player.Character[ModelName].Handle.Weld.C0 = CFrame.new()
  1049. EnableLimb(1, Player.Character)
  1050. EnableLimb(2, Player.Character)
  1051. DisableLimb(1, Player.Character)
  1052. CanUse = true
  1053. end
  1054. end
  1055. if Key == "f" then
  1056. CanUse = false
  1057. DisableLimb(2, Player.Character)
  1058. SetSpeed(1, 0.3, Player.Character)
  1059. SetSpeed(2, 0.3, Player.Character)
  1060. SetAngle(1, math.rad(45), Player.Character)
  1061. SetAngle(2, math.rad(45), Player.Character)
  1062. PlaySound("Slash", "rbxasset://sounds\\swordslash.wav", math.random(65, 80) / 100, 1, false, Player.Character[ModelName].Blade)
  1063. for i = 0, 1, 0.25 do
  1064. pcall(function()
  1065. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1.5 - (0.5 * i), 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90 + (45 * i)), 0)
  1066. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new(-1.5 + (0.5 * i), 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90 - (45 * i)), 0)
  1067. Player.Character[ModelName].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(90 * i), math.rad(213.25 * i), math.rad(-39 * i))
  1068. end)
  1069. wait()
  1070. end
  1071. pcall(function()
  1072. Player.Character[ModelName].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(100), math.rad(213.25), math.rad(-39))
  1073. end)
  1074. wait(0.35)
  1075. SetSpeed(1, 0.75, Player.Character)
  1076. SetSpeed(2, 0.75, Player.Character)
  1077. SetAngle(1, math.rad(135), Player.Character)
  1078. SetAngle(2, math.rad(135), Player.Character)
  1079. SetSwordDamage(15, 0.5)
  1080. Player.Character.Humanoid.Jump = true
  1081. local Connection = Player.Character[ModelName].Blade.Touched:connect(function(Hit)
  1082. if Hit:IsDescendantOf(Player.Character) then return end
  1083. pcall(function() Hit.Parent.Humanoid.Sit = true end)
  1084. pcall(function() Hit.Parent.Torso.Velocity = (Player.Character.Torso.CFrame.lookVector * math.random(10, 25)) + Vector3.new(math.random(-10, 10), 75, math.random(-10, 10)) end)
  1085. end)
  1086. for i = 0, 1, 0.25 do
  1087. pcall(function()
  1088. Player.Character[ModelName].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(100 + (45 * i)), math.rad(213.25 - (66.5 * i)), math.rad(-39))
  1089. end)
  1090. wait()
  1091. end
  1092. wait(0.5)
  1093. Connection:disconnect()
  1094. wait(0.25)
  1095. SetSpeed(1, 0.5, Player.Character)
  1096. SetSpeed(2, 0.5, Player.Character)
  1097. SetAngle(1, math.rad(90), Player.Character)
  1098. SetAngle(2, 0, Player.Character)
  1099. for i = 1, 0, -0.1 do
  1100. pcall(function()
  1101. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1.5 - (0.5 * i), 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90 + (45 * i)), 0)
  1102. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new(-1.5 + (0.5 * i), 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90 - (45 * i)), 0)
  1103. Player.Character[ModelName].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(145 * i), math.rad(146.75 * i), math.rad(-39 * i))
  1104. end)
  1105. wait()
  1106. end
  1107. pcall(function()
  1108. Player.Character[ModelName].Handle.Weld.C0 = CFrame.new()
  1109. end)
  1110. ResetLimbCFrame(1, Player.Character)
  1111. ResetLimbCFrame(2, Player.Character)
  1112. EnableLimb(1, Player.Character)
  1113. EnableLimb(2, Player.Character)
  1114. DisableLimb(1, Player.Character)
  1115. CanUse = true
  1116. end
  1117. if Key == "g" then
  1118. CanUse = false
  1119. DisableLimb(2, Player.Character)
  1120. SetSpeed(1, 0.3, Player.Character)
  1121. SetSpeed(2, 0.3, Player.Character)
  1122. SetAngle(1, math.rad(135), Player.Character)
  1123. SetAngle(2, math.rad(135), Player.Character)
  1124. PlaySound("Slash", "rbxasset://sounds\\swordslash.wav", math.random(65, 80) / 100, 1, false, Player.Character[ModelName].Blade)
  1125. for i = 0, 1, 0.25 do
  1126. pcall(function()
  1127. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1.5 - (0.5 * i), 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90 + (45 * i)), 0)
  1128. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new(-1.5 + (0.5 * i), 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90 - (45 * i)), 0)
  1129. Player.Character[ModelName].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(10 * i), math.rad(-28.125 * i), math.rad(-39 * i))
  1130. end)
  1131. wait()
  1132. end
  1133. pcall(function()
  1134. Player.Character[ModelName].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(10), math.rad(-28.125), math.rad(-39))
  1135. end)
  1136. Player.Character.Humanoid.Jump = true
  1137. wait(0.4)
  1138. SetSpeed(1, 0.75, Player.Character)
  1139. SetSpeed(2, 0.75, Player.Character)
  1140. SetAngle(1, math.rad(45), Player.Character)
  1141. SetAngle(2, math.rad(45), Player.Character)
  1142. SetSwordDamage(20, 0.5)
  1143. for i = 0, 1, 0.25 do
  1144. pcall(function()
  1145. Player.Character[ModelName].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(10 + (90 * i)), math.rad(-28.125 + (66.5 * i)), math.rad(-39))
  1146. end)
  1147. wait()
  1148. end
  1149. wait(0.5)
  1150. SetSpeed(1, 0.5, Player.Character)
  1151. SetSpeed(2, 0.5, Player.Character)
  1152. SetAngle(1, math.rad(90), Player.Character)
  1153. SetAngle(2, 0, Player.Character)
  1154. for i = 1, 0, -0.1 do
  1155. pcall(function()
  1156. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1.5 - (0.5 * i), 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90 + (45 * i)), 0)
  1157. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new(-1.5 + (0.5 * i), 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90 - (45 * i)), 0)
  1158. Player.Character[ModelName].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(145 * i), math.rad(146.75 * i), math.rad(-39 * i))
  1159. end)
  1160. wait()
  1161. end
  1162. pcall(function()
  1163. Player.Character[ModelName].Handle.Weld.C0 = CFrame.new()
  1164. end)
  1165. ResetLimbCFrame(1, Player.Character)
  1166. ResetLimbCFrame(2, Player.Character)
  1167. EnableLimb(1, Player.Character)
  1168. EnableLimb(2, Player.Character)
  1169. DisableLimb(1, Player.Character)
  1170. CanUse = true
  1171. end
  1172. if Key == "h" then
  1173. CanUse = false
  1174. local OldWalkSpeed = Player.Character.Humanoid.WalkSpeed
  1175. Player.Character.Humanoid.WalkSpeed = OldWalkSpeed / 10
  1176. SetAngle(1, math.rad(90), Player.Character)
  1177. SetSwordDamage(10)
  1178. for i = 0, 1, 0.01 do
  1179. pcall(function()
  1180. Player.Character[ModelName].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(0, math.rad(360 * 15 * i), 0)
  1181. end)
  1182. PlaySound("Slash", "rbxasset://sounds\\swordslash.wav", math.random(125, 200) / 100, 1, false, Player.Character[ModelName].Blade)
  1183. local Size = math.random(8, 12)
  1184. local Wave = Instance.new("Part")
  1185. Wave.Name = "Wave"
  1186. Wave.BrickColor = BrickColor.new("Light stone grey")
  1187. Wave.TopSurface = 0
  1188. Wave.BottomSurface = 0
  1189. Wave.Transparency = math.cos(i * math.pi * 1.85)
  1190. Wave.Transparency = Wave.Transparency < 0.4 and 0.4 or Wave.Transparency
  1191. Wave.Anchored = true
  1192. Wave.CanCollide = math.random(1, 3) == 1 and true or false
  1193. Wave.formFactor = "Custom"
  1194. Wave.Size = Vector3.new(Size, 1, Size)
  1195. Wave.CFrame = Player.Character["Right Arm"].CFrame * CFrame.new(0, math.random(-150, -125) / 100, 0) * CFrame.fromEulerAnglesXYZ(math.rad(math.random(-5, 5)), 0, math.rad(math.random(-5, 5)))
  1196. Wave.Parent = game:GetService("Workspace")
  1197. local Mesh = Instance.new("CylinderMesh", Wave)
  1198. Mesh.Scale = Vector3.new(1, 0.075, 1)
  1199. coroutine.wrap(function()
  1200. for i = Wave.Transparency, 1, 0.1 do
  1201. Wave.Transparency = i
  1202. wait()
  1203. end
  1204. Wave:Remove()
  1205. end)()
  1206. wait()
  1207. end
  1208. pcall(function()
  1209. Player.Character[ModelName].Handle.Weld.C0 = CFrame.new()
  1210. end)
  1211. SetSwordDamage("Default")
  1212. Player.Character.Humanoid.WalkSpeed = OldWalkSpeed
  1213. CanUse = true
  1214. end
  1215. if Key == "x" then
  1216. if Player.Character.Torso.Velocity.x > 2 or Player.Character.Torso.Velocity.y > 2 or Player.Character.Torso.Velocity.z > 2 or Player.Character.Torso.Velocity.x < -2 or Player.Character.Torso.Velocity.y < -2 or Player.Character.Torso.Velocity.z < -2 then return end
  1217. CanUse = false
  1218. Player.Character.Torso.Anchored = true
  1219. Player.Character.Humanoid.PlatformStand = true
  1220. local Pos = Player.Character.Torso.CFrame
  1221. DisableLimb(2, Player.Character)
  1222. DisableLimb(3, Player.Character)
  1223. DisableLimb(4, Player.Character)
  1224. SetSpeed(1, 0.3, Player.Character)
  1225. SetSpeed(2, 0.3, Player.Character)
  1226. SetSpeed(3, 0.3, Player.Character)
  1227. SetSpeed(4, 0.3, Player.Character)
  1228. SetAngle(1, math.rad(90), Player.Character)
  1229. SetAngle(2, math.rad(90), Player.Character)
  1230. SetAngle(3, 0, Player.Character)
  1231. SetAngle(4, 0, Player.Character)
  1232. for i = 0, 1, 0.25 do
  1233. pcall(function()
  1234. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1.5 - (0.5 * i), 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90 + (45 * i)), 0)
  1235. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new(-1.5 + (0.5 * i), 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90 - (45 * i)), 0)
  1236. Player.Character[ModelName].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(10 * i), math.rad(-28.125 * i), math.rad(-39 * i))
  1237. end)
  1238. wait()
  1239. end
  1240. wait(0.1)
  1241. for i = 0, math.pi, 0.05 do
  1242. Player.Character.Torso.CFrame = Pos * CFrame.new(0, math.sin(-i) + 0.25, math.sin(-i)) * CFrame.fromEulerAnglesXYZ(math.rad(math.sin(-i) * 80), 0, 0)
  1243. ForceAngle(3, math.rad(math.sin(i) * 80), Player.Character)
  1244. ForceAngle(4, math.rad(math.sin(i) * 80), Player.Character)
  1245. wait()
  1246. end
  1247. SetAngle(2, 0, Player.Character)
  1248. for i = 1, 0, -0.25 do
  1249. pcall(function()
  1250. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1.5 - (0.5 * i), 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90 + (45 * i)), 0)
  1251. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new(-1.5 + (0.5 * i), 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90 - (45 * i)), 0)
  1252. Player.Character[ModelName].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(10 * i), math.rad(-28.125 * i), math.rad(-39 * i))
  1253. end)
  1254. wait()
  1255. end
  1256. wait(0.1)
  1257. SetSpeed(1, 0.2, Player.Character)
  1258. SetSpeed(2, 0.2, Player.Character)
  1259. SetSpeed(3, 0.1, Player.Character)
  1260. SetSpeed(4, 0.1, Player.Character)
  1261. EnableLimb(1, Player.Character)
  1262. EnableLimb(2, Player.Character)
  1263. EnableLimb(3, Player.Character)
  1264. EnableLimb(4, Player.Character)
  1265. DisableLimb(1, Player.Character)
  1266. Player.Character.Torso.Velocity = Vector3.new(0, 0, 0)
  1267. Player.Character.Torso.Anchored = false
  1268. Player.Character.Humanoid.PlatformStand = false
  1269. CanUse = true
  1270. end
  1271. if Key == "j" then
  1272. CanUse = false
  1273. local OldWalkSpeed = Player.Character.Humanoid.WalkSpeed
  1274. local Direction = (Player.Character.Torso.CFrame.p - (Player.Character.Torso.CFrame * CFrame.new(3, 0, 0)).p).unit
  1275. Player.Character.Humanoid.WalkSpeed = 0
  1276. local BodyVelocity = Instance.new("BodyVelocity")
  1277. BodyVelocity.maxForce = Vector3.new(math.huge, 0, math.huge)
  1278. BodyVelocity.velocity = Direction * (OldWalkSpeed * 10)
  1279. BodyVelocity.Parent = Player.Character.Torso
  1280. for i = 1, 20 do
  1281. BodyVelocity.velocity = BodyVelocity.velocity / 1.2
  1282. wait()
  1283. end
  1284. BodyVelocity:Remove()
  1285. Player.Character.Humanoid.WalkSpeed = OldWalkSpeed
  1286. CanUse = true
  1287. end
  1288. if Key == "k" then
  1289. CanUse = false
  1290. local OldWalkSpeed = Player.Character.Humanoid.WalkSpeed
  1291. local Direction = (Player.Character.Torso.CFrame.p - (Player.Character.Torso.CFrame * CFrame.new(-3, 0, 0)).p).unit
  1292. Player.Character.Humanoid.WalkSpeed = 0
  1293. local BodyVelocity = Instance.new("BodyVelocity")
  1294. BodyVelocity.maxForce = Vector3.new(math.huge, 0, math.huge)
  1295. BodyVelocity.velocity = Direction * (OldWalkSpeed * 10)
  1296. BodyVelocity.Parent = Player.Character.Torso
  1297. for i = 1, 20 do
  1298. BodyVelocity.velocity = BodyVelocity.velocity / 1.2
  1299. wait()
  1300. end
  1301. BodyVelocity:Remove()
  1302. Player.Character.Humanoid.WalkSpeed = OldWalkSpeed
  1303. CanUse = true
  1304. end
  1305. if Key == "c" then
  1306. if not Player.Character:findFirstChild("ForceField") then
  1307. Instance.new("ForceField", Player.Character)
  1308. end
  1309. end
  1310. if Key == "v" then
  1311. if Player.Character:findFirstChild("ForceField") then
  1312. Player.Character:findFirstChild("ForceField"):remove()
  1313. end
  1314. end
  1315. if Key == "b" then
  1316. Player.Character.Humanoid.MaxHealth = math.huge
  1317. Player.Character.Humanoid.Health = math.huge
  1318. end
  1319. if Key == "n" then
  1320. Player.Character.Humanoid.MaxHealth = 100
  1321. Player.Character.Humanoid.Health = 100
  1322. end
  1323. if Key == "z" then
  1324. if KeyZDown == true then return end
  1325. local KeyZMaxTime = 25
  1326. if KeyZTime == nil then KeyZTime = KeyZMaxTime end
  1327. if KeyZTime <= 0 then return end
  1328. CanUse = false
  1329. KeyZDown = true
  1330. DisableLimb(2, Player.Character)
  1331. SetSpeed(1, 0.5, Player.Character)
  1332. SetSpeed(2, 0.5, Player.Character)
  1333. SetAngle(1, math.rad(10), Player.Character)
  1334. SetAngle(2, math.rad(10), Player.Character)
  1335. local KeyZMovement1 = Player.Character.Humanoid.Running:connect(function(Speed)
  1336. if Speed > 0 then
  1337. SetAngle(1, math.rad(-45), Player.Character)
  1338. SetAngle(2, math.rad(-45), Player.Character)
  1339. else
  1340. SetAngle(1, math.rad(10), Player.Character)
  1341. SetAngle(2, math.rad(10), Player.Character)
  1342. end
  1343. end)
  1344. local KeyZMovement2 = Player.Character.Humanoid.Jumping:connect(function()
  1345. --Player.Character.Torso.Velocity = Player.Character.Torso.Velocity + Vector3.new(0, 35, 0)
  1346. wait()
  1347. SetAngle(1, math.rad(-45), Player.Character)
  1348. SetAngle(2, math.rad(-45), Player.Character)
  1349. wait(0.15)
  1350. SetAngle(1, math.rad(180), Player.Character)
  1351. SetAngle(2, math.rad(180), Player.Character)
  1352. wait(0.5)
  1353. end)
  1354. local KeyZMovement3 = Player.Character.Humanoid.FreeFalling:connect(function()
  1355. SetAngle(1, math.rad(180), Player.Character)
  1356. SetAngle(2, math.rad(180), Player.Character)
  1357. end)
  1358. local Gui = Instance.new("ScreenGui", Player.PlayerGui)
  1359. Gui.Name = ModelName.. " Stamina Bar"
  1360. local BarUnderlay = Instance.new("Frame", Gui)
  1361. BarUnderlay.Name = "BarUnderlay"
  1362. BarUnderlay.BackgroundColor3 = Color3.new(1, 0, 0)
  1363. BarUnderlay.BorderColor3 = Color3.new(0, 0, 0)
  1364. BarUnderlay.Size = UDim2.new(0, 250, 0, 15)
  1365. BarUnderlay.Position = UDim2.new(1, -300, 1, -100)
  1366. local BarOverlay = Instance.new("Frame", Gui)
  1367. BarOverlay.Name = "BarOverlay"
  1368. BarOverlay.BackgroundColor3 = Color3.new(0, 1, 0)
  1369. BarOverlay.BorderColor3 = Color3.new(0, 0, 0)
  1370. BarOverlay.Position = UDim2.new(1, -300, 1, -100)
  1371. local TextLabel = Instance.new("TextLabel", Gui)
  1372. TextLabel.Name = "Stamina"
  1373. TextLabel.Text = "Stamina"
  1374. TextLabel.BackgroundTransparency = 1
  1375. TextLabel.BorderSizePixel = 1
  1376. TextLabel.Size = UDim2.new(0, 250, 0, 15)
  1377. TextLabel.Position = UDim2.new(1, -300, 1, -100)
  1378. coroutine.wrap(function()
  1379. for i = 1, 0, -0.1 do
  1380. BarUnderlay.BackgroundTransparency = i
  1381. BarOverlay.BackgroundTransparency = i
  1382. TextLabel.TextTransparency = i
  1383. wait()
  1384. end
  1385. end)()
  1386. local OldWalkSpeed = Player.Character.Humanoid.WalkSpeed
  1387. Player.Character.Humanoid.WalkSpeed = 0
  1388. wait(0.1)
  1389. Player.Character.Humanoid.WalkSpeed = OldWalkSpeed * 2.5
  1390. while KeyZDown == true and KeyZTime > 0 and Selected == true do
  1391. KeyZTime = KeyZTime - 0.1
  1392. BarOverlay.Size = UDim2.new(0, 250 - ((1 - (KeyZTime / KeyZMaxTime)) * 250), 0, 15)
  1393. wait()
  1394. end
  1395. KeyZMovement1:disconnect()
  1396. KeyZMovement2:disconnect()
  1397. KeyZMovement3:disconnect()
  1398. Player.Character.Humanoid.WalkSpeed = 0
  1399. wait(0.1)
  1400. Player.Character.Humanoid.WalkSpeed = OldWalkSpeed
  1401. SetSpeed(1, 0.2, Player.Character)
  1402. SetSpeed(2, 0.2, Player.Character)
  1403. SetAngle(1, math.rad(90), Player.Character)
  1404. SetAngle(2, 0, Player.Character)
  1405. EnableLimb(1, Player.Character)
  1406. EnableLimb(2, Player.Character)
  1407. DisableLimb(1, Player.Character)
  1408. while KeyZDown == true and Selected == true do
  1409. wait()
  1410. end
  1411. CanUse = true
  1412. while KeyZDown == false and KeyZTime < KeyZMaxTime and Selected == true do
  1413. KeyZTime = KeyZTime + 0.09
  1414. BarOverlay.Size = UDim2.new(0, 250 - ((1 - (KeyZTime / KeyZMaxTime)) * 250), 0, 15)
  1415. wait()
  1416. end
  1417. coroutine.wrap(function()
  1418. for i = 0, 1, 0.05 do
  1419. BarUnderlay.BackgroundTransparency = i
  1420. BarOverlay.BackgroundTransparency = i
  1421. TextLabel.TextTransparency = i
  1422. wait()
  1423. end
  1424. Gui:Remove()
  1425. end)()
  1426. end
  1427. end
  1428. end
  1429.  
  1430.  
  1431. function onKeyUp(Key, Mouse)
  1432. if Selected == false then return end
  1433. Key = Key:lower()
  1434. if Key == "z" then
  1435. KeyZDown = false
  1436. elseif Key == "t" then
  1437. KeyTDown = false
  1438. elseif Key == "y" then
  1439. KeyYDown = false
  1440. end
  1441. if CheckPlayer() == true then
  1442. if Button1Down == false and CanUse == true then
  1443.  
  1444. end
  1445. end
  1446. end
  1447.  
  1448.  
  1449. function onSelected(Mouse)
  1450. if script.Parent.Active == false then return end
  1451. if Selected == true then return end
  1452. while true do
  1453. if Player.Character:findFirstChild("Black Katana (Holstered)") and Player.Character:findFirstChild("Back Katana") then
  1454. Player.Character:findFirstChild("Black Katana (Holstered)"):remove()
  1455. end
  1456. if CheckPlayer() == true then
  1457. if Player.Character.Torso:FindFirstChild("Right Shoulder") ~= nil then
  1458. break
  1459. end
  1460. end
  1461. wait(0.1)
  1462. end
  1463. Selected = true
  1464. if script.Parent.Active == false then return end
  1465. CanUse = false
  1466. DisableLimb(1, Player.Character)
  1467. SetSpeed(1, 0.5, Player.Character)
  1468. SetAngle(1, 0, Player.Character)
  1469. DisableLimb(2, Player.Character)
  1470. SetSpeed(2, 0.5, Player.Character)
  1471. SetAngle(2, 0, Player.Character)
  1472. wait(0.05)
  1473. for i = 0, 1, 0.1 do
  1474. pcall(function()
  1475. Player.Character.Torso["Right Shoulder 2"].C0 =
  1476. CFrame.new(-0.05 * i, 0.11 * i, -0.8 * i) * CFrame.fromEulerAnglesXYZ(math.rad(50) * i, 0, math.rad(-45) * i) *
  1477. CFrame.new(1.5 * (1 - i), 0.5 * (1 - i), 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90) * (1 - i), 0)
  1478. Player.Character.Torso["Right Shoulder 2"].C1 =
  1479. CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90) * (1 - i), 0)
  1480. end)
  1481. wait()
  1482. end
  1483. RemoveParts(Player.Character, 1)
  1484. CreateParts(Player.Character, 2)
  1485. pcall(function()
  1486. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(-0.05, 0.11, -0.8) * CFrame.fromEulerAnglesXYZ(math.rad(50), 0, math.rad(-45))
  1487. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(0, 0.5, 0)
  1488. Player.Character[ModelName].Handle.Weld.C0 = CFrame.new(0, 0, -0.1) * CFrame.fromEulerAnglesXYZ(math.rad(200), 0, math.rad(-45))
  1489. end)
  1490. wait(0.1)
  1491. PlaySound("Unsheath", "rbxasset://sounds\\unsheath.wav", 1.25, 1, false, Player.Character[ModelName].Sheath)
  1492. SetSwordDamage(10, 0.5)
  1493. SetSpeed(2, 0.025, Player.Character)
  1494. SetAngle(2, math.rad(-15), Player.Character)
  1495. for i = 0, 1, 0.1 do
  1496. pcall(function()
  1497. Player.Character.Torso["Right Shoulder 2"].C0 =
  1498. CFrame.new(-0.05 + (0.4 * i), 0.11 + (0.49 * i), -0.8 - (0.1 * i)) * CFrame.fromEulerAnglesXYZ(math.rad(50 + (130 * i)), 0, math.rad(-45 + (10 * i)))
  1499. Player.Character[ModelName].Handle.Weld.C0 = CFrame.new(0.2 * i, 0, -0.5 * i) * CFrame.fromEulerAnglesXYZ(math.rad(200 + (87.5 * i)), 0, math.rad(-45 - (3 * i)))
  1500. Player.Character[ModelName].Sheath.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(150 - (40 * i)), math.rad(17.5 * i), 0)
  1501. Player.Character[ModelName].Sheath.Weld.C1 = CFrame.new(-1.1 - (0.375 * i), -1.75, 0.5 - (0.2 * i))
  1502. end)
  1503. wait()
  1504. end
  1505. SetAngle(2, 0, Player.Character)
  1506. pcall(function()
  1507. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(0.35, 0.6, -0.9) * CFrame.fromEulerAnglesXYZ(math.rad(180), 0, math.rad(-35))
  1508. Player.Character[ModelName].Handle.Weld.C0 = CFrame.new(0.2, 0, -0.5) * CFrame.fromEulerAnglesXYZ(math.rad(287.5), 0, math.rad(-48))
  1509. Player.Character[ModelName].Sheath.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(110), math.rad(17.5), 0)
  1510. Player.Character[ModelName].Sheath.Weld.C1 = CFrame.new(-1.475, -1.75, 0.3)
  1511. end)
  1512. SetAngle(1, math.rad(90), Player.Character)
  1513. for i = 0, 1, 0.1 do
  1514. pcall(function()
  1515. Player.Character.Torso["Right Shoulder 2"].C0 =
  1516. CFrame.new(1.5 * i, 0.5 * i, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90) * i, 0) *
  1517. CFrame.new(0.35 * (1 - i), 0.6 * (1 - i), -0.9 * (1 - i)) * CFrame.fromEulerAnglesXYZ(math.rad(180 * (1 - i)), 0, math.rad(-35 * (1 - i)))
  1518. Player.Character.Torso["Right Shoulder 2"].C1 =
  1519. CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90) * i, 0)
  1520. Player.Character[ModelName].Handle.Weld.C0 = CFrame.new(0.2 * (1 - i), 0, -0.5 * (1 - i)) * CFrame.fromEulerAnglesXYZ(math.rad(287.5 * (1 - i)), 0, math.rad(-48 * (1 - i)))
  1521. Player.Character[ModelName].Sheath.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(110 + (40 * i)), math.rad(17.5 * (1 - i)), 0)
  1522. Player.Character[ModelName].Sheath.Weld.C1 = CFrame.new(-1.475 + (0.375 * i), -1.75, 0.3 + (0.2 * i))
  1523. end)
  1524. wait()
  1525. end
  1526. ResetLimbCFrame(1, Player.Character)
  1527. EnableLimb(1, Player.Character)
  1528. SetSpeed(2, 0.2, Player.Character)
  1529. SetAngle(2, 0, Player.Character)
  1530. EnableLimb(2, Player.Character)
  1531. DisableLimb(1, Player.Character)
  1532. Mouse.Icon = "rbxasset://textures\\GunCursor.png"
  1533. Mouse.Button1Down:connect(function() onButton1Down(Mouse) end)
  1534. Mouse.Button1Up:connect(function() onButton1Up(Mouse) end)
  1535. Mouse.KeyDown:connect(function(Key) onKeyDown(Key, Mouse) end)
  1536. Mouse.KeyUp:connect(function(Key) onKeyUp(Key, Mouse) end)
  1537. CanUse = true
  1538. end
  1539.  
  1540.  
  1541. function onDeselected(Mouse)
  1542. if Selected == false then return end
  1543. Selected = false
  1544. while CanUse == false do wait() end
  1545. RemoveParts(Player.Character, 2)
  1546. CreateParts(Player.Character, 1)
  1547. while Selected == false do
  1548. if CheckPlayer() == true then
  1549. if Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1550. break
  1551. end
  1552. end
  1553. wait(0.1)
  1554. end
  1555. if Selected == true then return end
  1556. CanUse = false
  1557. RemoveParts(Player.Character, 1)
  1558. CreateParts(Player.Character, 2)
  1559. SetSpeed(1, 0.5, Player.Character)
  1560. SetAngle(1, 0, Player.Character)
  1561. DisableLimb(2, Player.Character)
  1562. SetSpeed(2, 0.5, Player.Character)
  1563. SetAngle(2, 0, Player.Character)
  1564. wait(0.1)
  1565. SetSpeed(2, 0.025, Player.Character)
  1566. SetAngle(2, math.rad(-15), Player.Character)
  1567. for i = 1, 0, -0.1 do
  1568. pcall(function()
  1569. Player.Character.Torso["Right Shoulder 2"].C0 =
  1570. CFrame.new(1.5 * i, 0.5 * i, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90) * i, 0) *
  1571. CFrame.new(0.35 * (1 - i), 0.6 * (1 - i), -0.9 * (1 - i)) * CFrame.fromEulerAnglesXYZ(math.rad(180 * (1 - i)), 0, math.rad(-35 * (1 - i)))
  1572. Player.Character.Torso["Right Shoulder 2"].C1 =
  1573. CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90) * i, 0)
  1574. Player.Character[ModelName].Handle.Weld.C0 = CFrame.new(0.2 * (1 - i), 0, -0.5 * (1 - i)) * CFrame.fromEulerAnglesXYZ(math.rad(287.5 * (1 - i)), 0, math.rad(-48 * (1 - i)))
  1575. Player.Character[ModelName].Sheath.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(110 + (40 * i)), math.rad(17.5 * (1 - i)), 0)
  1576. Player.Character[ModelName].Sheath.Weld.C1 = CFrame.new(-1.475 + (0.375 * i), -1.75, 0.3 + (0.2 * i))
  1577. end)
  1578. wait()
  1579. end
  1580. pcall(function()
  1581. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(0.35, 0.6, -0.9) * CFrame.fromEulerAnglesXYZ(math.rad(180), 0, math.rad(-35))
  1582. Player.Character[ModelName].Handle.Weld.C0 = CFrame.new(0.2, 0, -0.5) * CFrame.fromEulerAnglesXYZ(math.rad(287.5), 0, math.rad(-48))
  1583. Player.Character[ModelName].Sheath.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(110), math.rad(17.5), 0)
  1584. Player.Character[ModelName].Sheath.Weld.C1 = CFrame.new(-1.475, -1.75, 0.3)
  1585. end)
  1586. PlaySound("Sheath", "rbxasset://sounds\\unsheath.wav", -1.1, 1, true, Player.Character[ModelName].Sheath)
  1587. coroutine.wrap(function()
  1588. while Player.Character[ModelName].Sheath:FindFirstChild("Sheath") == nil do
  1589. wait()
  1590. end
  1591. wait(0.05)
  1592. Player.Character[ModelName].Sheath.Sheath.Looped = false
  1593. end)()
  1594. wait(0.15)
  1595. SetAngle(2, 0, Player.Character)
  1596. for i = 1, 0, -0.1 do
  1597. pcall(function()
  1598. Player.Character.Torso["Right Shoulder 2"].C0 =
  1599. CFrame.new(-0.05 + (0.4 * i), 0.11 + (0.49 * i), -0.8 - (0.1 * i)) * CFrame.fromEulerAnglesXYZ(math.rad(50 + (130 * i)), 0, math.rad(-45 + (10 * i)))
  1600. Player.Character[ModelName].Handle.Weld.C0 = CFrame.new(0.2 * i, 0, -0.5 * i) * CFrame.fromEulerAnglesXYZ(math.rad(200 + (87.5 * i)), 0, math.rad(-45 - (3 * i)))
  1601. Player.Character[ModelName].Sheath.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(150 - (40 * i)), math.rad(17.5 * i), 0)
  1602. Player.Character[ModelName].Sheath.Weld.C1 = CFrame.new(-1.1 - (0.375 * i), -1.75, 0.5 - (0.2 * i))
  1603. end)
  1604. wait()
  1605. end
  1606. pcall(function()
  1607. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(-0.05, 0.11, -0.8) * CFrame.fromEulerAnglesXYZ(math.rad(50), 0, math.rad(-45))
  1608. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(0, 0.5, 0)
  1609. Player.Character[ModelName].Handle.Weld.C0 = CFrame.new(0, 0, -0.1) * CFrame.fromEulerAnglesXYZ(math.rad(200), 0, math.rad(-45))
  1610. end)
  1611. RemoveParts(Player.Character, 2)
  1612. CreateParts(Player.Character, 1)
  1613. for i = 1, 0, -0.1 do
  1614. pcall(function()
  1615. Player.Character.Torso["Right Shoulder 2"].C0 =
  1616. CFrame.new(-0.05 * i, 0.11 * i, -0.8 * i) * CFrame.fromEulerAnglesXYZ(math.rad(50) * i, 0, math.rad(-45) * i) *
  1617. CFrame.new(1.5 * (1 - i), 0.5 * (1 - i), 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90) * (1 - i), 0)
  1618. Player.Character.Torso["Right Shoulder 2"].C1 =
  1619. CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90) * (1 - i), 0)
  1620. end)
  1621. wait()
  1622. end
  1623. SetSpeed(1, 0.25, Player.Character)
  1624. SetAngle(1, 0, Player.Character)
  1625. ResetLimbCFrame(1, Player.Character)
  1626. EnableLimb(1, Player.Character)
  1627. SetSpeed(2, 0.2, Player.Character)
  1628. SetAngle(2, 0, Player.Character)
  1629. EnableLimb(2, Player.Character)
  1630. CanUse = true
  1631. end
  1632.  
  1633.  
  1634. if script:FindFirstChild("SoundData") ~= nil then
  1635. local Sound = Instance.new("Sound")
  1636. Sound.Name = script.SoundData._Name.Value
  1637. Sound.SoundId = script.SoundData._SoundId.Value
  1638. Sound.Pitch = script.SoundData._Pitch.Value
  1639. Sound.Volume = script.SoundData._Volume.Value
  1640. Sound.Looped = script.SoundData._Looped.Value
  1641. Sound.Parent = script.SoundData._Parent.Value
  1642. Sound:Play()
  1643. script:Remove()
  1644. elseif script:FindFirstChild("DamageData") ~= nil then
  1645. script.Parent.Touched:connect(function(Hit)
  1646. if Hit.Parent == nil then return end
  1647. if script.DamageData.Break.Value == true then Hit:BreakJoints() end
  1648. if Hit.Parent:FindFirstChild("Humanoid") == nil then return end
  1649. Hit.Parent.Humanoid:TakeDamage(script.DamageData.Damage.Value)
  1650. end)
  1651. elseif script.Parent.className ~= "HopperBin" then
  1652. if Player == nil then print("Error: Player not found!") return end
  1653. Tool = Instance.new("HopperBin")
  1654. Tool.Name = ModelName
  1655. Tool.Parent = Player.Backpack
  1656. script.Name = "Main"
  1657. script.Parent = Tool
  1658. elseif script.Parent.className == "HopperBin" and Connected == false then
  1659. Connected = true
  1660. Player = script.Parent.Parent.Parent
  1661. script.Parent.Selected:connect(onSelected)
  1662. script.Parent.Deselected:connect(onDeselected)
  1663. CreateParts(Player.Character, 1)
  1664. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement