Advertisement
aarontje11002

my own katana

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