Advertisement
Animescapetower

Sworda

Mar 16th, 2018
399
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 92.00 KB | None | 0 0
  1.  
  2. --Converted with ttyyuu12345's model to script plugin v4
  3. function sandbox(var,func)
  4. local env = getfenv(func)
  5. local newenv = setmetatable({},{
  6. __index = function(self,k)
  7. if k=="script" then
  8. return var
  9. else
  10. return env[k]
  11. end
  12. end,
  13. })
  14. setfenv(func,newenv)
  15. return func
  16. end
  17. cors = {}
  18. mas = Instance.new("Model",game:GetService("Lighting"))
  19. Tool0 = Instance.new("Tool")
  20. BoolValue1 = Instance.new("BoolValue")
  21. BoolValue2 = Instance.new("BoolValue")
  22. BoolValue3 = Instance.new("BoolValue")
  23. Animation4 = Instance.new("Animation")
  24. Animation5 = Instance.new("Animation")
  25. Animation6 = Instance.new("Animation")
  26. Animation7 = Instance.new("Animation")
  27. Animation8 = Instance.new("Animation")
  28. Animation9 = Instance.new("Animation")
  29. Animation10 = Instance.new("Animation")
  30. LocalScript11 = Instance.new("LocalScript")
  31. LocalScript12 = Instance.new("LocalScript")
  32. Script13 = Instance.new("Script")
  33. LocalScript14 = Instance.new("LocalScript")
  34. Animation15 = Instance.new("Animation")
  35. Animation16 = Instance.new("Animation")
  36. ParticleEmitter17 = Instance.new("ParticleEmitter")
  37. Script18 = Instance.new("Script")
  38. Animation19 = Instance.new("Animation")
  39. Animation20 = Instance.new("Animation")
  40. CFrameValue21 = Instance.new("CFrameValue")
  41. ScreenGui22 = Instance.new("ScreenGui")
  42. Frame23 = Instance.new("Frame")
  43. TextButton24 = Instance.new("TextButton")
  44. Script25 = Instance.new("Script")
  45. Frame26 = Instance.new("Frame")
  46. ScrollingFrame27 = Instance.new("ScrollingFrame")
  47. ImageButton28 = Instance.new("ImageButton")
  48. ImageLabel29 = Instance.new("ImageLabel")
  49. Color3Value30 = Instance.new("Color3Value")
  50. Color3Value31 = Instance.new("Color3Value")
  51. Script32 = Instance.new("Script")
  52. BrickColorValue33 = Instance.new("BrickColorValue")
  53. ImageButton34 = Instance.new("ImageButton")
  54. ImageLabel35 = Instance.new("ImageLabel")
  55. Color3Value36 = Instance.new("Color3Value")
  56. Color3Value37 = Instance.new("Color3Value")
  57. Script38 = Instance.new("Script")
  58. BrickColorValue39 = Instance.new("BrickColorValue")
  59. ImageButton40 = Instance.new("ImageButton")
  60. ImageLabel41 = Instance.new("ImageLabel")
  61. Color3Value42 = Instance.new("Color3Value")
  62. Color3Value43 = Instance.new("Color3Value")
  63. Script44 = Instance.new("Script")
  64. BrickColorValue45 = Instance.new("BrickColorValue")
  65. ImageButton46 = Instance.new("ImageButton")
  66. ImageLabel47 = Instance.new("ImageLabel")
  67. Color3Value48 = Instance.new("Color3Value")
  68. Color3Value49 = Instance.new("Color3Value")
  69. Script50 = Instance.new("Script")
  70. BrickColorValue51 = Instance.new("BrickColorValue")
  71. ImageButton52 = Instance.new("ImageButton")
  72. ImageLabel53 = Instance.new("ImageLabel")
  73. Color3Value54 = Instance.new("Color3Value")
  74. Color3Value55 = Instance.new("Color3Value")
  75. Script56 = Instance.new("Script")
  76. BrickColorValue57 = Instance.new("BrickColorValue")
  77. ImageButton58 = Instance.new("ImageButton")
  78. ImageLabel59 = Instance.new("ImageLabel")
  79. Color3Value60 = Instance.new("Color3Value")
  80. Color3Value61 = Instance.new("Color3Value")
  81. Script62 = Instance.new("Script")
  82. BrickColorValue63 = Instance.new("BrickColorValue")
  83. ImageButton64 = Instance.new("ImageButton")
  84. ImageLabel65 = Instance.new("ImageLabel")
  85. Color3Value66 = Instance.new("Color3Value")
  86. Color3Value67 = Instance.new("Color3Value")
  87. Script68 = Instance.new("Script")
  88. BrickColorValue69 = Instance.new("BrickColorValue")
  89. Script70 = Instance.new("Script")
  90. Part71 = Instance.new("Part")
  91. Animation72 = Instance.new("Animation")
  92. StringValue73 = Instance.new("StringValue")
  93. Script74 = Instance.new("Script")
  94. Script75 = Instance.new("Script")
  95. Script76 = Instance.new("Script")
  96. BindableEvent77 = Instance.new("BindableEvent")
  97. Part78 = Instance.new("Part")
  98. Sound79 = Instance.new("Sound")
  99. Sound80 = Instance.new("Sound")
  100. Sound81 = Instance.new("Sound")
  101. Sound82 = Instance.new("Sound")
  102. Sound83 = Instance.new("Sound")
  103. Sound84 = Instance.new("Sound")
  104. Sound85 = Instance.new("Sound")
  105. Sound86 = Instance.new("Sound")
  106. Sound87 = Instance.new("Sound")
  107. Sound88 = Instance.new("Sound")
  108. Sound89 = Instance.new("Sound")
  109. Sound90 = Instance.new("Sound")
  110. Sound91 = Instance.new("Sound")
  111. Fire92 = Instance.new("Fire")
  112. Script93 = Instance.new("Script")
  113. Script94 = Instance.new("Script")
  114. Sound95 = Instance.new("Sound")
  115. Sound96 = Instance.new("Sound")
  116. Sound97 = Instance.new("Sound")
  117. Sound98 = Instance.new("Sound")
  118. Folder99 = Instance.new("Folder")
  119. ParticleEmitter100 = Instance.new("ParticleEmitter")
  120. Sound101 = Instance.new("Sound")
  121. SpecialMesh102 = Instance.new("SpecialMesh")
  122. Animation103 = Instance.new("Animation")
  123. Script104 = Instance.new("Script")
  124. LocalScript105 = Instance.new("LocalScript")
  125. Folder106 = Instance.new("Folder")
  126. NumberValue107 = Instance.new("NumberValue")
  127. Script108 = Instance.new("Script")
  128. Animation109 = Instance.new("Animation")
  129. BoolValue110 = Instance.new("BoolValue")
  130. Model111 = Instance.new("Model")
  131. Part112 = Instance.new("Part")
  132. Part113 = Instance.new("Part")
  133. WedgePart114 = Instance.new("WedgePart")
  134. Part115 = Instance.new("Part")
  135. Part116 = Instance.new("Part")
  136. Part117 = Instance.new("Part")
  137. Part118 = Instance.new("Part")
  138. Part119 = Instance.new("Part")
  139. Part120 = Instance.new("Part")
  140. Script121 = Instance.new("Script")
  141. LocalScript122 = Instance.new("LocalScript")
  142. LocalScript123 = Instance.new("LocalScript")
  143. RemoteEvent124 = Instance.new("RemoteEvent")
  144. RemoteEvent125 = Instance.new("RemoteEvent")
  145. RemoteEvent126 = Instance.new("RemoteEvent")
  146. Animation127 = Instance.new("Animation")
  147. Tool0.Name = "Sword"
  148. Tool0.Parent = mas
  149. Tool0.GripForward = Vector3.new(1, -0, -0)
  150. Tool0.GripPos = Vector3.new(0, 0.0776660442, 0.10033416)
  151. Tool0.GripRight = Vector3.new(0, 0, 1)
  152. Tool0.ToolTip = "The attacks are powerful"
  153. Tool0.CanBeDropped = false
  154. BoolValue1.Name = "PlayOverhead"
  155. BoolValue1.Parent = Tool0
  156. BoolValue2.Name = "PlaySlash"
  157. BoolValue2.Parent = Tool0
  158. BoolValue3.Name = "PlayThrust"
  159. BoolValue3.Parent = Tool0
  160. Animation4.Name = "IdleAnim3"
  161. Animation4.Parent = Tool0
  162. Animation4.AnimationId = "rbxassetid://846744780"
  163. Animation5.Name = "OverheadAnim2"
  164. Animation5.Parent = Tool0
  165. Animation5.AnimationId = "rbxassetid://846744780"
  166. Animation6.Name = "SlashAnim2"
  167. Animation6.Parent = Tool0
  168. Animation6.AnimationId = "rbxassetid://846754447"
  169. Animation7.Name = "ThrustAnim2"
  170. Animation7.Parent = Tool0
  171. Animation7.AnimationId = "rbxassetid://846744780"
  172. Animation8.Name = "UnequipAnim2"
  173. Animation8.Parent = Tool0
  174. Animation8.AnimationId = "rbxassetid://846744780"
  175. Animation9.Name = "EquipAnim5"
  176. Animation9.Parent = Tool0
  177. Animation9.AnimationId = "rbxassetid://846744780"
  178. Animation10.Name = "Swing1"
  179. Animation10.Parent = Tool0
  180. Animation10.AnimationId = "rbxassetid://218504594"
  181. LocalScript11.Name = "AnimationScript"
  182. LocalScript11.Parent = Tool0
  183. table.insert(cors,sandbox(LocalScript11,function()
  184. -- Waits for the child of the specified parent
  185. local function WaitForChild(parent, childName)
  186. while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
  187. return parent[childName]
  188. end
  189.  
  190. local Tool = script.Parent
  191.  
  192. local Animations = {}
  193. local MyHumanoid
  194. local MyCharacter
  195.  
  196.  
  197. local function PlayAnimation(animationName)
  198. if Animations[animationName] then
  199. Animations[animationName]:Play()
  200. end
  201. end
  202.  
  203. local function StopAnimation(animationName)
  204. if Animations[animationName] then
  205. Animations[animationName]:Stop()
  206. end
  207. end
  208.  
  209.  
  210. function OnEquipped(mouse)
  211. MyCharacter = Tool.Parent
  212. MyHumanoid = WaitForChild(MyCharacter, 'Humanoid')
  213. if MyHumanoid then
  214. Animations['EquipAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'EquipAnim5'))
  215. Animations['IdleAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'IdleAnim3'))
  216. Animations['OverheadAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'OverheadAnim2'))
  217. Animations['SlashAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'SlashAnim2'))
  218. Animations['ThrustAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'ThrustAnim2'))
  219. Animations['UnequipAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'UnequipAnim2'))
  220. end
  221.  
  222. Animations['EquipAnim']:Play(.1,.8,1)
  223. PlayAnimation('IdleAnim')
  224. end
  225.  
  226. function OnUnequipped()
  227. Tool.Handle.deactivate:Play()
  228. for animName, _ in pairs(Animations) do
  229. StopAnimation(animName)
  230. end
  231. end
  232.  
  233. Tool.Equipped:connect(OnEquipped)
  234. Tool.Unequipped:connect(OnUnequipped)
  235.  
  236. WaitForChild(Tool, 'PlaySlash').Changed:connect(
  237. function (value)
  238. --if value then
  239. PlayAnimation('SlashAnim')
  240. --else
  241. -- StopAnimation('SlashAnim')
  242. --end
  243. end)
  244.  
  245. WaitForChild(Tool, 'PlayThrust').Changed:connect(
  246. function (value)
  247. --if value then
  248. PlayAnimation('ThrustAnim')
  249. --else
  250. -- StopAnimation('ThrustAnim')
  251. --end
  252. end)
  253.  
  254. WaitForChild(Tool, 'PlayOverhead').Changed:connect(
  255. function (value)
  256. --if value then
  257. Animations['OverheadAnim']:Play()
  258. --else
  259. -- StopAnimation('OverheadAnim')
  260. --end
  261. end)
  262.  
  263. end))
  264. LocalScript12.Name = "Local Gui"
  265. LocalScript12.Parent = Tool0
  266. table.insert(cors,sandbox(LocalScript12,function()
  267. local Tool = script.Parent;
  268. enabled = true
  269. function onButton1Down(mouse)
  270. if not enabled then
  271. return
  272. end
  273.  
  274. enabled = false
  275. mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
  276. while not Tool.Enabled do
  277. wait(0.05)
  278. end
  279.  
  280. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  281. enabled = true
  282.  
  283. end
  284.  
  285. function onEquippedLocal(mouse)
  286. for _, part in pairs(script.Parent.Parent:GetChildren()) do
  287. if part.Name == "Saber" then
  288. part:remove()
  289. end
  290. end
  291. wait(1)
  292. spawn(function()
  293. emitters={}
  294. local rnswdch=Tool:GetChildren()
  295. for i, v in pairs(rnswdch) do
  296. if v.Name=='Part' then
  297.  
  298. local bldch2=v:GetChildren()
  299. for i, v in pairs(bldch2) do
  300. if v.ClassName=='ParticleEmitter' or v.ClassName == 'Trail' then
  301. table.insert(emitters,v)
  302. end
  303. end
  304. end
  305. end
  306.  
  307. for i, v in pairs(emitters) do
  308. v.Enabled=true
  309. end
  310. end)
  311. wait(0.2)
  312. spawn(function()
  313. emitters2={}
  314. local rnswdch=Tool:GetChildren()
  315. for i, v in pairs(rnswdch) do
  316. if v.Name=='Union' or v.Name=='Handle' then
  317. v.Transparency=1
  318. local bldch2=v:GetChildren()
  319. for i, v in pairs(bldch2) do
  320. if v.ClassName=='ParticleEmitter' or v.ClassName == 'Trail' then
  321. table.insert(emitters2,v)
  322. end
  323. end
  324. end
  325. end
  326.  
  327. for i, v in pairs(emitters2) do
  328. v.Enabled=true
  329. end
  330. end)
  331. if mouse == nil then
  332. print("Mouse not found")
  333. return
  334. end
  335.  
  336. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  337. mouse.Button1Down:connect(function() onButton1Down(mouse) end)
  338. end
  339. Tool.Unequipped:connect(function()
  340. spawn(function()
  341. local rnswdch=Tool:GetChildren()
  342. for i, v in pairs(rnswdch) do
  343. if v.Name=='Union' or v.Name=='Union' then
  344. v.Transparency=1
  345. end
  346. end
  347. for i, v in pairs(emitters) do
  348. v.Enabled=false
  349. end
  350. end)
  351. spawn(function()
  352. local rnswdch=Tool:GetChildren()
  353. for i, v in pairs(rnswdch) do
  354. if v.Name=='Union' then
  355. v.Transparency=0
  356. end
  357. end
  358. for i, v in pairs(emitters2) do
  359. v.Enabled=false
  360. end
  361. end)
  362. wait(0.002)
  363. if script.Parent.Parent ~= game.Workspace then
  364. ready = true
  365. m = Instance.new("Model")
  366. m.Name = "Saber"
  367. m.Parent = script.Parent.Parent.Parent.Character
  368. for _, part in pairs(script.Parent:GetChildren()) do
  369. if part.ClassName == "Part" or part.ClassName == 'UnionOperation' then
  370. if part.Name~='Part' and part.Name~='Part' and part.Name~='Part' and part.Name~='Cord'then
  371. p = part:clone()
  372. p.Anchored = false
  373. p.CanCollide = false
  374. p.Parent = m
  375. print(p)
  376. end
  377. end
  378. end
  379. s = script.AutoWeld:clone()
  380. s.Parent = m
  381. s.Disabled = false
  382. for _, parts in pairs(m:GetChildren()) do
  383. if parts.ClassName == "Part" or parts.ClassName == 'UnionOperation' then
  384. p.Anchored = false
  385. print(p)
  386. end
  387. end
  388. w = Instance.new("Weld")
  389. w.Parent = m.Handle
  390. w.Part0 = script.Parent.Parent.Parent.Character.RightUpperArm
  391. w.Part1 = m.Handle
  392. w.C0 = CFrame.new(-.6, .8, .1)*CFrame.Angles(math.pi*1.6, 0, 0)
  393. end
  394. end)
  395.  
  396. Tool.Equipped:connect(onEquippedLocal)
  397.  
  398. end))
  399. Script13.Name = "AutoWeld"
  400. Script13.Parent = LocalScript12
  401. Script13.Disabled = true
  402. table.insert(cors,sandbox(Script13,function()
  403. --This script automatically welds your tool (if it's a tool)
  404. --Else place it inside a model full of bricks to weld them together!
  405. --Script from free models, Modified to be universal by Redyz!
  406.  
  407. --Sure you can edit both the script and the comment but the latter would be mean, no?
  408.  
  409. PartFound = nil
  410.  
  411. function Weld(x,y)
  412. local W = Instance.new("Weld")
  413. W.Part0 = x
  414. W.Part1 = y
  415. local CJ = CFrame.new(x.Position)
  416. local C0 = x.CFrame:inverse()*CJ
  417. local C1 = y.CFrame:inverse()*CJ
  418. W.C0 = C0
  419. W.C1 = C1
  420. W.Parent = x
  421. end
  422.  
  423. function Get(A) --Get all parts
  424. if A.className == "Part" then
  425. if script.Parent:FindFirstChild("Handle") ~= nil then
  426. Weld(script.Parent.Handle, A) --You're a tool
  427. else
  428. Weld(PartFound, A) --Not a tool
  429. end
  430. A.Anchored = false
  431. else
  432. local C = A:GetChildren()
  433. for i=1, #C do
  434. Get(C[i])
  435. end
  436. end
  437. end
  438.  
  439. function Finale()
  440. if(script.Parent:FindFirstChild("Handle")) ~= nil then -- A tool
  441. Get(script.Parent)
  442. else -- Something else~!
  443. List = script.Parent:GetChildren()
  444. for i = 1, #List do
  445. if List[i].ClassName == "Part" then --Find First Part
  446. PartFound = List[i]
  447. break
  448. end
  449. end
  450. Get(PartFound.Parent)
  451. end
  452. end
  453.  
  454. if script.Parent.ClassName == "Tool" then
  455. Finale() --In case the tool is sitting in the workspace
  456. script.Parent.Equipped:connect(Finale) --When you equip it
  457. script.Parent.Unequipped:connect(Finale) --And when you unequip it
  458. else
  459. Finale() --But I'm not a tool!
  460. end
  461. end))
  462. LocalScript14.Name = "Force Powers"
  463. LocalScript14.Parent = Tool0
  464. table.insert(cors,sandbox(LocalScript14,function()
  465. script.Parent.Equipped:connect(function(m)
  466. plr=game.Players:GetPlayerFromCharacter(script.Parent.Parent)
  467. char=script.Parent.Parent
  468. MyHumanoid=char.Humanoid
  469. LastSpace=0
  470. LastTeleport=0
  471. t=char.UpperTorso
  472. childList={}
  473.  
  474. local Animations = {}
  475.  
  476. local function WaitForChild(parent, childName)
  477. while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
  478. return parent[childName]
  479. end
  480.  
  481. Animations['EquipAnim'] = MyHumanoid:LoadAnimation(WaitForChild(script, 'EquipAnim5'))
  482. Animations['Roar'] = MyHumanoid:LoadAnimation(WaitForChild(script, 'Roar'))
  483. Animations['Jump'] = MyHumanoid:LoadAnimation(WaitForChild(script, 'Jump'))
  484. Animations['Force'] = MyHumanoid:LoadAnimation(WaitForChild(script, 'Force'))
  485.  
  486.  
  487. function f (p)
  488. p.RocketPropulsion:Fire()
  489. end
  490. m.KeyDown:connect(function(key)
  491. if key == 'g' then
  492. t=m.Target
  493. if t.Parent.ClassName=='Tool' and (plr.Character['Right Arm'].Position - t.Position).magnitude<=50 then
  494. Animations['Force']:Play(.1,.8,2)
  495. rp=Instance.new('RocketPropulsion')
  496. rp.Target=plr.Character['Right Arm']
  497. print(plr.Character.Name)
  498. rp.Parent=m.Target
  499. f(rp.Parent)
  500. t.Parent.Equipped:connect(function()
  501. rp:remove()
  502. end)
  503. else return
  504. end
  505. t=plr.Character.UpperTorso
  506. --print (nkey)
  507. elseif key == 'u' then
  508. if tick()-LastSpace < 1 and tick()-LastTeleport >3 then
  509. fury()
  510. LastTeleport = tick()
  511. Animations['Jump']:Play(.1,1,3)
  512. t.Velocity = t.Velocity + Vector3.new(0,120,0)
  513. wait(3)
  514. elseif tick()-LastTeleport >3 then
  515. LastSpace = tick()
  516. wait(12)
  517. Animations['Jump']:Stop()
  518. end
  519.  
  520. elseif key=='f' and d==nil then
  521. d=true
  522. fury()
  523. Animations['Roar']:Play()
  524. freeze()
  525. script.Parent.Handle.Fire:Play()
  526. wait(15)
  527. script.Parent.Handle.PowerUp:Play()
  528. wait(12)
  529. d=nil
  530. elseif key == 'q' then
  531. if d2==nil then
  532. d2=true
  533. Animations['Force']:Play(.1,.8,2)
  534. Taunt()
  535. wait(5)
  536. d2=nil
  537.  
  538. end
  539. elseif key == 'e' then
  540. if debounce2==nil then
  541. debounce2=true
  542. Animations['EquipAnim']:Play(.1,.8,2)
  543. rTaunt()
  544. wait(5)
  545. debounce2=nil
  546. end
  547. end
  548. end)
  549. function Taunt()
  550. --gather all of the humanoids in a 30stud radius
  551. local UpperTorsos = {}
  552. for _, p in pairs(game.Players:GetChildren()) do
  553. if p ~= plr then
  554. if p.Character and p.Character:FindFirstChild('UpperTorso') then
  555. UpperTorsos[#UpperTorsos+1] = p.Character.UpperTorso
  556. end
  557. end
  558. end
  559.  
  560. --now pull them in towards us
  561. local mpos = char.UpperTorso.Position
  562. for _, UpperTorso in pairs(UpperTorsos) do
  563. if (mpos-UpperTorso.Position).magnitude < 40 then
  564. local dir = (mpos-UpperTorso.Position).unit
  565. ------------ stolen from dagger of time to make a character "fly" in some direction
  566. local force = Instance.new("BodyVelocity")
  567. force.velocity = Vector3.new(0,1,0)
  568. force.Parent = UpperTorso
  569. UpperTorso.Velocity = dir*250
  570. game.Debris:AddItem(force, 0.5)
  571. ------------
  572. end
  573. end
  574. end
  575.  
  576. function rTaunt()
  577. --gather all of the humanoids in a 30stud radius
  578. local UpperTorsos = {}
  579. for _, p in pairs(game.Players:GetChildren()) do
  580. if p ~= game.Players:GetPlayerFromCharacter(char) then
  581. if p.Character and p.Character:FindFirstChild('UpperTorso') then
  582. UpperTorsos[#UpperTorsos+1] = p.Character.UpperTorso
  583. end
  584. end
  585. end
  586.  
  587. --now pull them in towards us
  588. local mpos = char.UpperTorso.Position
  589. for _, UpperTorso in pairs(UpperTorsos) do
  590. if (mpos-UpperTorso.Position).magnitude < 40 then
  591. local dir = (mpos-UpperTorso.Position).unit
  592. ------------ stolen from dagger of time to make a character "fly" in some direction
  593. local force = Instance.new("BodyVelocity")
  594. force.velocity = Vector3.new(0,1,0)
  595. force.Parent = UpperTorso
  596. UpperTorso.Velocity = -dir*250
  597. game.Debris:AddItem(force, 0.5)
  598. ------------
  599. end
  600. end
  601. end
  602.  
  603. function freeze()
  604. checkObject(workspace)
  605. for i, v in pairs(childList) do
  606. if (v.Position-char.UpperTorso.Position).magnitude<=50 then
  607. v.Anchored=true
  608. wait(7)
  609. v.Anchored=false
  610. else return
  611. end
  612. end
  613. end
  614.  
  615. function checkObject(obj) -- This is basically a function that finds all unanchored parts and adds them to childList.
  616. if (obj.className == "Part") and not (obj:IsDescendantOf(char)) then
  617. if (obj.Anchored == false) then
  618. table.insert(childList, 1, obj)
  619. end
  620. elseif (obj.className == "Model") or (obj.className == "Hat") or (obj.className == "Tool") or (obj == workspace) then
  621. local child = obj:GetChildren()
  622. for x = 1, #child do
  623. checkObject(child[x])
  624. end
  625. obj.ChildAdded:connect(checkObject)
  626. end
  627. end
  628.  
  629. function fury()
  630. ch=char:GetChildren()
  631. for i, v in pairs(ch) do
  632. if v.ClassName=='Part' then
  633. fp=script:WaitForChild('EffectFire'):Clone()
  634. fp.Enabled=true
  635. fp.Parent=v
  636. fp.Script.Disabled=false
  637. end
  638. end
  639. end
  640. end)
  641. end))
  642. Animation15.Name = "EquipAnim5"
  643. Animation15.Parent = LocalScript14
  644. Animation15.AnimationId = "rbxassetid://27751170"
  645. Animation16.Name = "Jump"
  646. Animation16.Parent = LocalScript14
  647. Animation16.AnimationId = "rbxassetid://235542946"
  648. ParticleEmitter17.Name = "EffectFire"
  649. ParticleEmitter17.Parent = LocalScript14
  650. ParticleEmitter17.Transparency = NumberSequence.new(0.89999997615814,0.89999997615814)
  651. ParticleEmitter17.Size = NumberSequence.new(10,10)
  652. ParticleEmitter17.Color = ColorSequence.new(Color3.new(1, 1, 0),Color3.new(0.333333, 1, 0),Color3.new(0.333333, 1, 1),Color3.new(0, 0.333333, 1),Color3.new(0.333333, 0, 1),Color3.new(1, 0, 1),Color3.new(1, 0, 0),Color3.new(0, 1, 1),Color3.new(0, 1, 0),Color3.new(1, 1, 0))
  653. ParticleEmitter17.Enabled = false
  654. ParticleEmitter17.LightEmission = 0.25
  655. ParticleEmitter17.Texture = "rbxassetid://1242655587"
  656. ParticleEmitter17.ZOffset = 1
  657. ParticleEmitter17.Acceleration = Vector3.new(0, 1.5, 0)
  658. ParticleEmitter17.Lifetime = NumberRange.new(1, 1)
  659. ParticleEmitter17.Rate = 50
  660. ParticleEmitter17.Speed = NumberRange.new(45, 45)
  661. ParticleEmitter17.VelocitySpread = 700
  662. ParticleEmitter17.Color = ColorSequence.new(Color3.new(1, 1, 0),Color3.new(0.333333, 1, 0),Color3.new(0.333333, 1, 1),Color3.new(0, 0.333333, 1),Color3.new(0.333333, 0, 1),Color3.new(1, 0, 1),Color3.new(1, 0, 0),Color3.new(0, 1, 1),Color3.new(0, 1, 0),Color3.new(1, 1, 0))
  663. Script18.Parent = ParticleEmitter17
  664. Script18.Disabled = true
  665. table.insert(cors,sandbox(Script18,function()
  666. wait(3)
  667. script.Parent:remove()
  668. end))
  669. Animation19.Name = "Roar"
  670. Animation19.Parent = LocalScript14
  671. Animation19.AnimationId = "rbxassetid://105371766"
  672. Animation20.Name = "Force"
  673. Animation20.Parent = LocalScript14
  674. Animation20.AnimationId = "rbxassetid://32326240"
  675. CFrameValue21.Name = "og"
  676. CFrameValue21.Parent = Tool0
  677. CFrameValue21.Value = CFrame.new(0, -2.21224976, -0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  678. ScreenGui22.Name = "SaberColorGui"
  679. ScreenGui22.Parent = Tool0
  680. Frame23.Parent = ScreenGui22
  681. Frame23.Transparency = 1
  682. Frame23.Size = UDim2.new(0.100000001, 0, 0.300000012, 0)
  683. Frame23.Position = UDim2.new(-0.100000001, 0, 0.5, 0)
  684. Frame23.BackgroundColor3 = Color3.new(1, 1, 1)
  685. Frame23.BackgroundTransparency = 1
  686. TextButton24.Name = "Open/Close"
  687. TextButton24.Parent = Frame23
  688. TextButton24.Rotation = 90
  689. TextButton24.Size = UDim2.new(1.10000002, 0, 0.300000012, 0)
  690. TextButton24.Style = Enum.ButtonStyle.RobloxRoundDropdownButton
  691. TextButton24.Text = "Saber Color"
  692. TextButton24.Position = UDim2.new(0.649999976, 0, 0.340000004, 0)
  693. TextButton24.BackgroundColor3 = Color3.new(1, 1, 1)
  694. TextButton24.FontSize = Enum.FontSize.Size14
  695. TextButton24.TextWrapped = true
  696. Script25.Parent = TextButton24
  697. table.insert(cors,sandbox(Script25,function()
  698. out=false
  699. script.Parent.MouseButton1Click:connect(function()
  700. if out==false then
  701. out=true
  702. for i=1, 20 do
  703. script.Parent.Parent.Position=script.Parent.Parent.Position+UDim2.new((0.1/20),0,0,0)
  704. wait(0.02)
  705. end
  706. elseif out==true then
  707. out=false
  708. for i=1, 20 do
  709. script.Parent.Parent.Position=script.Parent.Parent.Position+UDim2.new((-0.1/20),0,0,0)
  710. wait(0.02)
  711. end
  712. end
  713. end)
  714. end))
  715. Frame26.Parent = Frame23
  716. Frame26.Transparency = 1
  717. Frame26.Size = UDim2.new(1, 0, 1, 0)
  718. Frame26.BackgroundColor3 = Color3.new(1, 1, 1)
  719. Frame26.BackgroundTransparency = 1
  720. ScrollingFrame27.Parent = Frame26
  721. ScrollingFrame27.Transparency = 0.20000000298023
  722. ScrollingFrame27.Size = UDim2.new(1, 0, 1, 0)
  723. ScrollingFrame27.BackgroundColor3 = Color3.new(0.32549, 0.32549, 0.32549)
  724. ScrollingFrame27.BackgroundTransparency = 0.20000000298023
  725. ScrollingFrame27.ZIndex = 2
  726. ImageButton28.Name = "Color Option"
  727. ImageButton28.Parent = ScrollingFrame27
  728. ImageButton28.Size = UDim2.new(0.899999976, 0, 0.100000001, 0)
  729. ImageButton28.BackgroundColor3 = Color3.new(0, 0.666667, 1)
  730. ImageButton28.ZIndex = 3
  731. ImageLabel29.Name = "CoreDisplay"
  732. ImageLabel29.Parent = ImageButton28
  733. ImageLabel29.Size = UDim2.new(1, 0, 0.699999988, 0)
  734. ImageLabel29.Position = UDim2.new(0, 0, 0.100000001, 0)
  735. ImageLabel29.BackgroundColor3 = Color3.new(1, 1, 1)
  736. ImageLabel29.BorderSizePixel = 0
  737. ImageLabel29.ZIndex = 4
  738. Color3Value30.Name = "Core"
  739. Color3Value30.Parent = ImageButton28
  740. Color3Value30.Value = Color3.new(1, 1, 1)
  741. Color3Value31.Name = "Glow"
  742. Color3Value31.Parent = ImageButton28
  743. Color3Value31.Value = Color3.new(0, 1, 0)
  744. Script32.Parent = ImageButton28
  745. table.insert(cors,sandbox(Script32,function()
  746. script.Parent.BackgroundColor3=script.Parent.Glow.Value
  747. script.Parent.CoreDisplay.BackgroundColor3=script.Parent.Core.Value
  748. end))
  749. BrickColorValue33.Name = "Neon"
  750. BrickColorValue33.Parent = ImageButton28
  751. BrickColorValue33.Value = BrickColor.new("Institutional white")
  752. ImageButton34.Name = "Color Option"
  753. ImageButton34.Parent = ScrollingFrame27
  754. ImageButton34.Size = UDim2.new(0.899999976, 0, 0.100000001, 0)
  755. ImageButton34.Position = UDim2.new(0, 0, 0.109999999, 0)
  756. ImageButton34.BackgroundColor3 = Color3.new(0, 0.666667, 1)
  757. ImageButton34.ZIndex = 3
  758. ImageLabel35.Name = "CoreDisplay"
  759. ImageLabel35.Parent = ImageButton34
  760. ImageLabel35.Size = UDim2.new(1, 0, 0.699999988, 0)
  761. ImageLabel35.Position = UDim2.new(0, 0, 0.100000001, 0)
  762. ImageLabel35.BackgroundColor3 = Color3.new(1, 1, 1)
  763. ImageLabel35.BorderSizePixel = 0
  764. ImageLabel35.ZIndex = 4
  765. Color3Value36.Name = "Core"
  766. Color3Value36.Parent = ImageButton34
  767. Color3Value36.Value = Color3.new(1, 1, 1)
  768. Color3Value37.Name = "Glow"
  769. Color3Value37.Parent = ImageButton34
  770. Color3Value37.Value = Color3.new(1, 0, 0)
  771. Script38.Parent = ImageButton34
  772. table.insert(cors,sandbox(Script38,function()
  773. script.Parent.BackgroundColor3=script.Parent.Glow.Value
  774. script.Parent.CoreDisplay.BackgroundColor3=script.Parent.Core.Value
  775. end))
  776. BrickColorValue39.Name = "Neon"
  777. BrickColorValue39.Parent = ImageButton34
  778. BrickColorValue39.Value = BrickColor.new("Light orange")
  779. ImageButton40.Name = "Color Option"
  780. ImageButton40.Parent = ScrollingFrame27
  781. ImageButton40.Size = UDim2.new(0.899999976, 0, 0.100000001, 0)
  782. ImageButton40.Position = UDim2.new(0, 0, 0.219999999, 0)
  783. ImageButton40.BackgroundColor3 = Color3.new(0, 0.666667, 1)
  784. ImageButton40.ZIndex = 3
  785. ImageLabel41.Name = "CoreDisplay"
  786. ImageLabel41.Parent = ImageButton40
  787. ImageLabel41.Size = UDim2.new(1, 0, 0.699999988, 0)
  788. ImageLabel41.Position = UDim2.new(0, 0, 0.100000001, 0)
  789. ImageLabel41.BackgroundColor3 = Color3.new(1, 1, 1)
  790. ImageLabel41.BorderSizePixel = 0
  791. ImageLabel41.ZIndex = 4
  792. Color3Value42.Name = "Core"
  793. Color3Value42.Parent = ImageButton40
  794. Color3Value43.Name = "Glow"
  795. Color3Value43.Parent = ImageButton40
  796. Color3Value43.Value = Color3.new(1, 1, 1)
  797. Script44.Parent = ImageButton40
  798. table.insert(cors,sandbox(Script44,function()
  799. script.Parent.BackgroundColor3=script.Parent.Glow.Value
  800. script.Parent.CoreDisplay.BackgroundColor3=script.Parent.Core.Value
  801. end))
  802. BrickColorValue45.Name = "Neon"
  803. BrickColorValue45.Parent = ImageButton40
  804. BrickColorValue45.Value = BrickColor.new("Really black")
  805. ImageButton46.Name = "Color Option"
  806. ImageButton46.Parent = ScrollingFrame27
  807. ImageButton46.Size = UDim2.new(0.899999976, 0, 0.100000001, 0)
  808. ImageButton46.Position = UDim2.new(0, 0, 0.330000013, 0)
  809. ImageButton46.BackgroundColor3 = Color3.new(0, 0.666667, 1)
  810. ImageButton46.ZIndex = 3
  811. ImageLabel47.Name = "CoreDisplay"
  812. ImageLabel47.Parent = ImageButton46
  813. ImageLabel47.Size = UDim2.new(1, 0, 0.699999988, 0)
  814. ImageLabel47.Position = UDim2.new(0, 0, 0.100000001, 0)
  815. ImageLabel47.BackgroundColor3 = Color3.new(1, 1, 1)
  816. ImageLabel47.BorderSizePixel = 0
  817. ImageLabel47.ZIndex = 4
  818. Color3Value48.Name = "Core"
  819. Color3Value48.Parent = ImageButton46
  820. Color3Value48.Value = Color3.new(1, 1, 1)
  821. Color3Value49.Name = "Glow"
  822. Color3Value49.Parent = ImageButton46
  823. Color3Value49.Value = Color3.new(0, 0.333333, 1)
  824. Script50.Parent = ImageButton46
  825. table.insert(cors,sandbox(Script50,function()
  826. script.Parent.BackgroundColor3=script.Parent.Glow.Value
  827. script.Parent.CoreDisplay.BackgroundColor3=script.Parent.Core.Value
  828. end))
  829. BrickColorValue51.Name = "Neon"
  830. BrickColorValue51.Parent = ImageButton46
  831. BrickColorValue51.Value = BrickColor.new("Institutional white")
  832. ImageButton52.Name = "Color Option"
  833. ImageButton52.Parent = ScrollingFrame27
  834. ImageButton52.Size = UDim2.new(0.899999976, 0, 0.100000001, 0)
  835. ImageButton52.Position = UDim2.new(0, 0, 0.439999998, 0)
  836. ImageButton52.BackgroundColor3 = Color3.new(0, 0.666667, 1)
  837. ImageButton52.ZIndex = 3
  838. ImageLabel53.Name = "CoreDisplay"
  839. ImageLabel53.Parent = ImageButton52
  840. ImageLabel53.Size = UDim2.new(1, 0, 0.699999988, 0)
  841. ImageLabel53.Position = UDim2.new(0, 0, 0.100000001, 0)
  842. ImageLabel53.BackgroundColor3 = Color3.new(1, 1, 1)
  843. ImageLabel53.BorderSizePixel = 0
  844. ImageLabel53.ZIndex = 4
  845. Color3Value54.Name = "Core"
  846. Color3Value54.Parent = ImageButton52
  847. Color3Value54.Value = Color3.new(1, 1, 1)
  848. Color3Value55.Name = "Glow"
  849. Color3Value55.Parent = ImageButton52
  850. Color3Value55.Value = Color3.new(1, 1, 1)
  851. Script56.Parent = ImageButton52
  852. table.insert(cors,sandbox(Script56,function()
  853. script.Parent.BackgroundColor3=script.Parent.Glow.Value
  854. script.Parent.CoreDisplay.BackgroundColor3=script.Parent.Core.Value
  855. end))
  856. BrickColorValue57.Name = "Neon"
  857. BrickColorValue57.Parent = ImageButton52
  858. BrickColorValue57.Value = BrickColor.new("Institutional white")
  859. ImageButton58.Name = "Color Option"
  860. ImageButton58.Parent = ScrollingFrame27
  861. ImageButton58.Size = UDim2.new(0.899999976, 0, 0.100000001, 0)
  862. ImageButton58.Position = UDim2.new(0, 0, 0.550000012, 0)
  863. ImageButton58.BackgroundColor3 = Color3.new(0, 0.666667, 1)
  864. ImageButton58.ZIndex = 3
  865. ImageLabel59.Name = "CoreDisplay"
  866. ImageLabel59.Parent = ImageButton58
  867. ImageLabel59.Size = UDim2.new(1, 0, 0.699999988, 0)
  868. ImageLabel59.Position = UDim2.new(0, 0, 0.100000001, 0)
  869. ImageLabel59.BackgroundColor3 = Color3.new(1, 1, 1)
  870. ImageLabel59.BorderSizePixel = 0
  871. ImageLabel59.ZIndex = 4
  872. Color3Value60.Name = "Core"
  873. Color3Value60.Parent = ImageButton58
  874. Color3Value60.Value = Color3.new(1, 1, 1)
  875. Color3Value61.Name = "Glow"
  876. Color3Value61.Parent = ImageButton58
  877. Color3Value61.Value = Color3.new(0.666667, 0, 0.498039)
  878. Script62.Parent = ImageButton58
  879. table.insert(cors,sandbox(Script62,function()
  880. script.Parent.BackgroundColor3=script.Parent.Glow.Value
  881. script.Parent.CoreDisplay.BackgroundColor3=script.Parent.Core.Value
  882. end))
  883. BrickColorValue63.Name = "Neon"
  884. BrickColorValue63.Parent = ImageButton58
  885. BrickColorValue63.Value = BrickColor.new("Institutional white")
  886. ImageButton64.Name = "Color Option"
  887. ImageButton64.Parent = ScrollingFrame27
  888. ImageButton64.Size = UDim2.new(0.899999976, 0, 0.100000001, 0)
  889. ImageButton64.Position = UDim2.new(0, 0, 0.660000026, 0)
  890. ImageButton64.BackgroundColor3 = Color3.new(0, 0.666667, 1)
  891. ImageButton64.ZIndex = 3
  892. ImageLabel65.Name = "CoreDisplay"
  893. ImageLabel65.Parent = ImageButton64
  894. ImageLabel65.Size = UDim2.new(1, 0, 0.699999988, 0)
  895. ImageLabel65.Position = UDim2.new(0, 0, 0.100000001, 0)
  896. ImageLabel65.BackgroundColor3 = Color3.new(1, 1, 1)
  897. ImageLabel65.BorderSizePixel = 0
  898. ImageLabel65.ZIndex = 4
  899. Color3Value66.Name = "Core"
  900. Color3Value66.Parent = ImageButton64
  901. Color3Value66.Value = Color3.new(1, 1, 1)
  902. Color3Value67.Name = "Glow"
  903. Color3Value67.Parent = ImageButton64
  904. Color3Value67.Value = Color3.new(1, 1, 0.498039)
  905. Script68.Parent = ImageButton64
  906. table.insert(cors,sandbox(Script68,function()
  907. script.Parent.BackgroundColor3=script.Parent.Glow.Value
  908. script.Parent.CoreDisplay.BackgroundColor3=script.Parent.Core.Value
  909. end))
  910. BrickColorValue69.Name = "Neon"
  911. BrickColorValue69.Parent = ImageButton64
  912. BrickColorValue69.Value = BrickColor.new("Institutional white")
  913. Script70.Name = "qPerfectionWeld"
  914. Script70.Parent = Tool0
  915. table.insert(cors,sandbox(Script70,function()
  916. -- Created by Quenty (@Quenty, follow me on twitter).
  917. -- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
  918. -- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
  919.  
  920. --[[ INSTRUCTIONS
  921. - Place in the model
  922. - Make sure model is anchored
  923. - That's it. It will weld the model and all children.
  924.  
  925. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  926. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  927. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  928. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  929. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  930. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  931. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  932. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  933.  
  934. This script is designed to be used is a regular script. In a local script it will weld, but it will not attempt to handle ancestory changes.
  935. ]]
  936.  
  937. --[[ DOCUMENTATION
  938. - Will work in tools. If ran more than once it will not create more than one weld. This is especially useful for tools that are dropped and then picked up again.
  939. - Will work in PBS servers
  940. - Will work as long as it starts out with the part anchored
  941. - Stores the relative CFrame as a CFrame value
  942. - Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
  943. - Utilizes a recursive algorith to find all parts in the model
  944. - Will reweld on script reparent if the script is initially parented to a tool.
  945. - Welds as fast as possible
  946. ]]
  947.  
  948. -- qPerfectionWeld.lua
  949. -- Created 10/6/2014
  950. -- Author: Quenty
  951. -- Version 1.0.3
  952.  
  953. -- Updated 10/14/2014 - Updated to 1.0.1
  954. --- Bug fix with existing ROBLOX welds ? Repro by asimo3089
  955.  
  956. -- Updated 10/14/2014 - Updated to 1.0.2
  957. --- Fixed bug fix.
  958.  
  959. -- Updated 10/14/2014 - Updated to 1.0.3
  960. --- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
  961.  
  962. local NEVER_BREAK_JOINTS = false -- If you set this to true it will never break joints (this can create some welding issues, but can save stuff like hinges).
  963.  
  964.  
  965. local function CallOnChildren(Instance, FunctionToCall)
  966. -- Calls a function on each of the children of a certain object, using recursion.
  967.  
  968. FunctionToCall(Instance)
  969.  
  970. for _, Child in next, Instance:GetChildren() do
  971. CallOnChildren(Child, FunctionToCall)
  972. end
  973. end
  974.  
  975. local function GetNearestParent(Instance, ClassName)
  976. -- Returns the nearest parent of a certain class, or returns nil
  977.  
  978. local Ancestor = Instance
  979. repeat
  980. Ancestor = Ancestor.Parent
  981. if Ancestor == nil then
  982. return nil
  983. end
  984. until Ancestor:IsA(ClassName)
  985.  
  986. return Ancestor
  987. end
  988.  
  989. local function GetBricks(StartInstance)
  990. local List = {}
  991.  
  992. -- if StartInstance:IsA("BasePart") then
  993. -- List[#List+1] = StartInstance
  994. -- end
  995.  
  996. CallOnChildren(StartInstance, function(Item)
  997. if Item:IsA("BasePart") then
  998. List[#List+1] = Item;
  999. end
  1000. end)
  1001.  
  1002. return List
  1003. end
  1004.  
  1005. local function Modify(Instance, Values)
  1006. -- Modifies an Instance by using a table.
  1007.  
  1008. assert(type(Values) == "table", "Values is not a table");
  1009.  
  1010. for Index, Value in next, Values do
  1011. if type(Index) == "number" then
  1012. Value.Parent = Instance
  1013. else
  1014. Instance[Index] = Value
  1015. end
  1016. end
  1017. return Instance
  1018. end
  1019.  
  1020. local function Make(ClassType, Properties)
  1021. -- Using a syntax hack to create a nice way to Make new items.
  1022.  
  1023. return Modify(Instance.new(ClassType), Properties)
  1024. end
  1025.  
  1026. local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
  1027. local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
  1028.  
  1029. local function HasWheelJoint(Part)
  1030. for _, SurfaceName in pairs(Surfaces) do
  1031. for _, HingSurfaceName in pairs(HingSurfaces) do
  1032. if Part[SurfaceName].Name == HingSurfaceName then
  1033. return true
  1034. end
  1035. end
  1036. end
  1037.  
  1038. return false
  1039. end
  1040.  
  1041. local function ShouldBreakJoints(Part)
  1042. --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
  1043. -- definitely some edge cases.
  1044.  
  1045. if NEVER_BREAK_JOINTS then
  1046. return false
  1047. end
  1048.  
  1049. if HasWheelJoint(Part) then
  1050. return false
  1051. end
  1052.  
  1053. local Connected = Part:GetConnectedParts()
  1054.  
  1055. if #Connected == 1 then
  1056. return false
  1057. end
  1058.  
  1059. for _, Item in pairs(Connected) do
  1060. if HasWheelJoint(Item) then
  1061. return false
  1062. elseif not Item:IsDescendantOf(script.Parent) then
  1063. return false
  1064. end
  1065. end
  1066.  
  1067. return true
  1068. end
  1069.  
  1070. local function WeldTogether(Part0, Part1, JointType, WeldParent)
  1071. --- Weld's 2 parts together
  1072. -- @param Part0 The first part
  1073. -- @param Part1 The second part (Dependent part most of the time).
  1074. -- @param [JointType] The type of joint. Defaults to weld.
  1075. -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
  1076. -- @return The weld created.
  1077.  
  1078. JointType = JointType or "Weld"
  1079. local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
  1080.  
  1081. local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
  1082. Modify(NewWeld, {
  1083. Name = "qCFrameWeldThingy";
  1084. Part0 = Part0;
  1085. Part1 = Part1;
  1086. C0 = CFrame.new();--Part0.CFrame:inverse();
  1087. C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
  1088. Parent = Part1;
  1089. })
  1090.  
  1091. if not RelativeValue then
  1092. RelativeValue = Make("CFrameValue", {
  1093. Parent = Part1;
  1094. Name = "qRelativeCFrameWeldValue";
  1095. Archivable = true;
  1096. Value = NewWeld.C1;
  1097. })
  1098. end
  1099.  
  1100. return NewWeld
  1101. end
  1102.  
  1103. local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
  1104. -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
  1105. -- @param MainPart The part to weld the model to (can be in the model).
  1106. -- @param [JointType] The type of joint. Defaults to weld.
  1107. -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
  1108.  
  1109. for _, Part in pairs(Parts) do
  1110. if ShouldBreakJoints(Part) then
  1111. Part:BreakJoints()
  1112. end
  1113. end
  1114.  
  1115. for _, Part in pairs(Parts) do
  1116. if Part ~= MainPart then
  1117. WeldTogether(MainPart, Part, JointType, MainPart)
  1118. end
  1119. end
  1120.  
  1121. if not DoNotUnanchor then
  1122. for _, Part in pairs(Parts) do
  1123. Part.Anchored = false
  1124. end
  1125. MainPart.Anchored = false
  1126. end
  1127. end
  1128.  
  1129. local function PerfectionWeld()
  1130. local Tool = GetNearestParent(script, "Tool")
  1131.  
  1132. local Parts = GetBricks(script.Parent)
  1133. local PrimaryPart = Tool and Tool:FindFirstChild("Handle") and Tool.Handle:IsA("BasePart") and Tool.Handle or script.Parent:IsA("Model") and script.Parent.PrimaryPart or Parts[1]
  1134.  
  1135. if PrimaryPart then
  1136. WeldParts(Parts, PrimaryPart, "Weld", false)
  1137. else
  1138. warn("qWeld - Unable to weld part")
  1139. end
  1140.  
  1141. return Tool
  1142. end
  1143.  
  1144. local Tool = PerfectionWeld()
  1145.  
  1146.  
  1147. if Tool and script.ClassName == "Script" then
  1148. --- Don't bother with local scripts
  1149.  
  1150. script.Parent.AncestryChanged:connect(function()
  1151. PerfectionWeld()
  1152. end)
  1153. end
  1154.  
  1155. -- Created by Quenty (@Quenty, follow me on twitter).
  1156.  
  1157. end))
  1158. Part71.Name = "HitBox"
  1159. Part71.Parent = Tool0
  1160. Part71.Transparency = 1
  1161. Part71.Rotation = Vector3.new(0, 0, -50)
  1162. Part71.CanCollide = false
  1163. Part71.FormFactor = Enum.FormFactor.Custom
  1164. Part71.Size = Vector3.new(2.55149984, 6.80400038, 0.283499986)
  1165. Part71.CFrame = CFrame.new(-18.7105408, 0.498775721, -17.0065994, 0.64278698, 0.766044974, 0, -0.766044974, 0.64278698, 0, 0, 0, 1)
  1166. Part71.Position = Vector3.new(-18.7105408, 0.498775721, -17.0065994)
  1167. Part71.Orientation = Vector3.new(0, 0, -50)
  1168. Animation72.Name = "R15Swing2"
  1169. Animation72.Parent = Tool0
  1170. Animation72.AnimationId = "rbxassetid://846754447"
  1171. StringValue73.Name = "Credits To TheDoctorTD"
  1172. StringValue73.Parent = Tool0
  1173. StringValue73.Value = "For the hilt"
  1174. Script74.Name = "SwordScript"
  1175. Script74.Parent = Tool0
  1176. table.insert(cors,sandbox(Script74,function()
  1177. r = game:service("RunService")
  1178.  
  1179. local damage =45
  1180.  
  1181. sword = script.Parent.Handle
  1182. Tool = script.Parent
  1183.  
  1184. originalgrip=script.Parent.og
  1185. sp=script.Parent
  1186.  
  1187. function spinsword(spintime)
  1188. delay(0,function()
  1189. local startspin=tick()
  1190. local endspin=startspin+spintime
  1191. while tick()<endspin do
  1192. sp.Grip=originalgrip.Value*CFrame.Angles(math.pi*2*((tick()-startspin)/spintime),0,0)
  1193. wait()
  1194. end
  1195. sp.Grip=originalgrip.Value
  1196. end)
  1197. end
  1198.  
  1199. local damages,values,sounds = {30,45,65},{Tool.PlaySlash,Tool.PlayThrust,Tool.PlayOverhead},{Tool.Handle.SlashSound,Tool.Handle.OverheadSound,Tool.Handle.LungeSound}
  1200. local enabledToDamage = true
  1201.  
  1202. function blow(hit)
  1203. if enabledToDamage == false then return end
  1204. enabledToDamage = false
  1205. if (hit.Parent == nil) then enabledToDamage = true return end -- happens when bullet hits sword
  1206. local humanoid = hit.Parent:findFirstChild("Humanoid")
  1207. local vCharacter = Tool.Parent
  1208. local vPlayer = game.Players:playerFromCharacter(vCharacter)
  1209. local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
  1210. if humanoid~=nil and humanoid ~= hum and hum ~= nil then
  1211. -- final check, make sure sword is in-hand
  1212. local right_arm = vCharacter:FindFirstChild("RightUpperArm")
  1213. if (right_arm ~= nil) then
  1214. local joint = right_arm:FindFirstChild("RightGrip")
  1215. if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
  1216. tagHumanoid(humanoid, vPlayer)
  1217. humanoid:TakeDamage(damage)
  1218. humanoid.Died:connect(function()
  1219. if debounce==nil then
  1220. debounce=true
  1221. M=Instance.new('Model')
  1222. M.Name=humanoid.Parent.Name.."'s Body"
  1223. h=Instance.new('Humanoid')
  1224. h.Health=0
  1225. h.DisplayDistanceType=Enum.HumanoidDisplayDistanceType.None
  1226. h.Parent=M
  1227. T1=humanoid.Parent.UpperTorso:Clone()
  1228. T1.Velocity=Vector3.new(math.random(-20,20),math.random(-20,20),math.random(-20,20))
  1229. T1.Size=Vector3.new(2,1,1)
  1230. T1.Material=Enum.Material.Neon
  1231. T1.BrickColor=BrickColor.new('Light orange')
  1232. T2=humanoid.Parent.UpperTorso:Clone()
  1233. T2.Material=Enum.Material.Neon
  1234. T2.BrickColor=BrickColor.new('Light orange')
  1235. T2.Size=Vector3.new(2,1,1)
  1236. LA=humanoid.Parent['LeftUpperLeg']:Clone()
  1237. LL=humanoid.Parent['LeftUpperArm']:Clone()
  1238. RA=humanoid.Parent['RightUpperLeg']:Clone()
  1239. RL=humanoid.Parent['RightUpperArm']:Clone()
  1240. H=humanoid.Parent['Head']:Clone()
  1241. game.Debris:AddItem(humanoid.Parent, .02)
  1242. game.Debris:AddItem(M,10)
  1243. wait(.01)
  1244. debounce=nil
  1245. end
  1246. function Weld(x,y)
  1247. local W = Instance.new("Weld")
  1248. W.Part0 = x
  1249. W.Part1 = y
  1250. local CJ = CFrame.new(x.Position)
  1251. local C0 = x.CFrame:inverse()*CJ
  1252. local C1 = y.CFrame:inverse()*CJ
  1253. W.C0 = C0
  1254. W.C1 = C1
  1255. W.Parent = x
  1256. end
  1257. Weld(T1,LA)
  1258. Weld(T1,RA)
  1259. Weld(T1,H)
  1260. Weld(T2,LL)
  1261. Weld(T2,RL)
  1262. T1.Parent=M
  1263. T1.CFrame=T1.CFrame+Vector3.new(0,2,0)
  1264. T2.Parent=M
  1265. LL.Parent=M
  1266. LA.Parent=M
  1267. RL.Parent=M
  1268. RA.Parent=M
  1269. H.Parent=M
  1270. ch=humanoid.Parent:GetChildren()
  1271. for i, v in pairs(ch) do
  1272. if v.ClassName=='CharacterMesh' and v.BodyPart~=Enum.BodyPart.UpperTorso then
  1273. cmc=v:Clone()
  1274. cmc.Parent=M
  1275. elseif v.ClassName=='Hat' then
  1276. htc=v.Handle:Clone()
  1277. Weld(htc, H)
  1278. htc.Parent=M
  1279. end
  1280. end
  1281. M.Parent=workspace
  1282. end)
  1283. untagHumanoid(humanoid)
  1284. else
  1285. enabledToDamage = true
  1286. end
  1287. else
  1288. enabledToDamage = true
  1289. end
  1290. else
  1291. enabledToDamage = true
  1292. end
  1293. end
  1294.  
  1295.  
  1296. function tagHumanoid(humanoid, player)
  1297. local creator_tag = Instance.new("ObjectValue")
  1298. creator_tag.Value = player
  1299. creator_tag.Name = "creator"
  1300. creator_tag.Parent = humanoid
  1301. end
  1302.  
  1303. function untagHumanoid(humanoid)
  1304. if humanoid ~= nil then
  1305. local tag = humanoid:findFirstChild("creator")
  1306. if tag ~= nil then
  1307. tag.Parent = nil
  1308. end
  1309. end
  1310. end
  1311.  
  1312.  
  1313. function attack()
  1314. damage = slash_damage
  1315. script.Parent.Handle.SlashSound:Play()
  1316. script.Parent.PlaySlash.Value = not script.Parent.PlaySlash.Value
  1317. end
  1318.  
  1319. function lunge()
  1320. damage = lunge_damage
  1321. script.Parent.Handle.LungeSound:Play()
  1322. script.Parent.PlayOverhead.Value = not script.Parent.PlayOverhead.Value
  1323. force = Instance.new("BodyVelocity")
  1324. force.velocity = Vector3.new(0,10,0) --Tool.Parent.UpperTorso.CFrame.lookVector * 80
  1325. force.Parent = Tool.Parent.UpperTorso
  1326. wait(.5)
  1327. force.Parent = nil
  1328. wait(.5)
  1329. damage = slash_damage
  1330. end
  1331.  
  1332.  
  1333. Tool.Enabled = true
  1334. local last_attack = 0
  1335. local status = 0
  1336.  
  1337. function onActivated()
  1338. if not Tool.Enabled then
  1339. return
  1340. end
  1341. Tool.Enabled = false
  1342. local character = Tool.Parent;
  1343. local humanoid = character.Humanoid
  1344. if humanoid == nil then
  1345. print("Humanoid not found")
  1346. return
  1347. end
  1348. t = r.Stepped:wait()
  1349. if (t - last_attack < 1.5) then
  1350. rndm=math.random(1,3)
  1351. if rndm==1 then
  1352. status=1
  1353. elseif rndm==2 then
  1354. status=2
  1355. elseif rndm==3 then
  1356. status=3
  1357. end
  1358. values[status].Value = not values[status].Value
  1359. damage = damages[status]
  1360. sounds[status]:Play()
  1361. enabledToDamage = true
  1362. wait(0.5)
  1363. enabledToDamage = false
  1364. end
  1365. last_attack = t
  1366. Tool.Enabled = true
  1367. end
  1368.  
  1369. function onEquipped()
  1370. wait(1)
  1371. Tool.Handle.UnsheathSound:Play()
  1372. end
  1373.  
  1374. Tool.Equipped:connect(onEquipped)
  1375. script.Parent.Activated:connect(onActivated)
  1376. connection = script.Parent.HitBox.Touched:connect(blow)
  1377. end))
  1378. Script75.Name = "Server"
  1379. Script75.Parent = Tool0
  1380. table.insert(cors,sandbox(Script75,function()
  1381. local Tool = script.Parent
  1382. local Remote = Tool:WaitForChild("Remote")
  1383. local Handle = Tool:WaitForChild("Handle")
  1384.  
  1385. local Heartbeat = game:GetService("RunService").Heartbeat
  1386.  
  1387. local FriendlyFire = false
  1388.  
  1389. local LeftDown = false
  1390.  
  1391. local AttackHoldTime = 0.5
  1392. local AttackAble = true
  1393. local AttackRestTime = 0.5
  1394. local AttackWindupTime = 0.2
  1395. local AttackDamaging = false
  1396. local AttackWindow = 0.6
  1397. local AttackVictims = {}
  1398. local AttackDamage = 0
  1399. local AttackProjectileSpeed = 128
  1400. local AttackProjectileDamage = 0
  1401. local AttackProjectileVictims = {}
  1402.  
  1403. local Character = nil
  1404. local Humanoid = nil
  1405.  
  1406. --returns the wielding player of this tool
  1407. function getPlayer()
  1408. local char = Tool.Parent
  1409. return game:GetService("Players"):GetPlayerFromCharacter(Character)
  1410. end
  1411.  
  1412. function AutoWeld(a, b, ModifiedCFrame)
  1413. local weld = Instance.new("ManualWeld", a)
  1414. weld.Part0 = a
  1415. weld.Part1 = b
  1416. weld.C0 = a.CFrame:inverse() * b.CFrame
  1417. a.Anchored = false
  1418. b.Anchored = false
  1419. if ModifiedCFrame then
  1420. weld.C0 = ModifiedCFrame
  1421. end
  1422. return weld
  1423. end
  1424.  
  1425. --helpfully checks a table for a specific value
  1426. function contains(t, v)
  1427. for _, val in pairs(t) do
  1428. if val == v then
  1429. return true
  1430. end
  1431. end
  1432. return false
  1433. end
  1434.  
  1435. --tags a human for the ROBLOX KO system
  1436. function tagHuman(human)
  1437. local tag = Instance.new("ObjectValue")
  1438. tag.Value = getPlayer()
  1439. tag.Name = "creator"
  1440. tag.Parent = human
  1441. game:GetService("Debris"):AddItem(tag)
  1442. end
  1443.  
  1444. --used by checkTeams
  1445. function sameTeam(otherHuman)
  1446. local player = getPlayer()
  1447. local otherPlayer = game:GetService("Players"):GetPlayerFromCharacter(otherHuman.Parent)
  1448. if player and otherPlayer then
  1449. if player == otherPlayer then
  1450. return true
  1451. end
  1452. if otherPlayer.Neutral then
  1453. return false
  1454. end
  1455. return player.TeamColor == otherPlayer.TeamColor
  1456. end
  1457. return false
  1458. end
  1459.  
  1460. --use this to determine if you want this human to be harmed or not, returns boolean
  1461. function checkTeams(otherHuman)
  1462. return not (sameTeam(otherHuman) and not FriendlyFire)
  1463. end
  1464.  
  1465. function DeathMessage()
  1466. spawn(function()
  1467. local Phrases = {"Sliced","Stunned","Dameged","Armor Broke"}
  1468. if not Character.Head:FindFirstChild("BillboardGui") then
  1469. local GUI = Instance.new("BillboardGui",Character.Head) GUI.Size = UDim2.new(0,3000,0,30) GUI.LightInfluence = 0 GUI.StudsOffset = Vector3.new(0,1.65,0) GUI.AlwaysOnTop = true
  1470. local TL = Instance.new("TextLabel",GUI) TL.Size = UDim2.new(1,0,1,0) TL.BorderSizePixel = 0 TL.BackgroundTransparency = 1 TL.TextStrokeColor3 = Color3.fromRGB(127,0,255) TL.TextStrokeTransparency = 0 TL.TextColor3 = Color3.new(0,0,0) TL.TextScaled = true TL.Text = Phrases[math.random(#Phrases)] TL.Font = "SciFi"
  1471. wait(1.5)
  1472. for i = 1,60 do
  1473. wait()
  1474. TL.TextTransparency = i/20
  1475. TL.TextStrokeTransparency = (i-20)/40
  1476. end
  1477. GUI:Destroy()
  1478. end
  1479. end)
  1480. end
  1481.  
  1482. function onHandleTouched(part)
  1483. if not AttackDamaging then return end
  1484. if part:IsDescendantOf(Tool.Parent) then return end
  1485.  
  1486. if part.Parent and part.Parent:FindFirstChild("Humanoid") then
  1487. local human = part.Parent.Humanoid
  1488. if checkTeams(human) and not contains(AttackVictims, human) then
  1489. tagHuman(human)
  1490. table.insert(AttackVictims, human)
  1491. human.Health = 0
  1492. DeathMessage()
  1493. end
  1494. end
  1495. end
  1496.  
  1497. function onProjectileTouched(part)
  1498. if part:IsDescendantOf(Tool.Parent) then return end
  1499.  
  1500. if part.Parent and part.Parent:FindFirstChild("Humanoid") then
  1501. local human = part.Parent.Humanoid
  1502. if checkTeams(human) and not contains(AttackProjectileVictims, human) then
  1503. tagHuman(human)
  1504. table.insert(AttackProjectileVictims, human)
  1505. human.Health = 0
  1506. DeathMessage()
  1507. end
  1508. end
  1509. end
  1510.  
  1511. function onLeftHold()
  1512. if not SCooldown then
  1513. print("Hold")
  1514. if Humanoid and Humanoid.RigType == Enum.HumanoidRigType.R15 then
  1515. Remote:FireClient(getPlayer(), "PlayAnimation", "R15Swing2")
  1516. else
  1517. Remote:FireClient(getPlayer(), "PlayAnimation", "Swing2")
  1518. end
  1519.  
  1520. delay(0.1, function()
  1521. Handle.Swing.Pitch = 1
  1522. Handle.Swing:Play()
  1523. delay(0.4, function()
  1524. Handle.Swing.Pitch = 1.25
  1525. Handle.Swing:Play()
  1526. delay(0.3, function()
  1527. Handle.Swing.Pitch = 1.75
  1528. Handle.Swing:Play()
  1529. Handle.Shot.Pitch = 2
  1530. end)
  1531. end)
  1532. end)
  1533.  
  1534. wait(0.8)
  1535.  
  1536. local root = Tool.Parent:FindFirstChild("HumanoidRootPart")
  1537. if root then
  1538. for i = 1,3 do
  1539. local slash = Instance.new("Part")
  1540. slash.Material = "Neon"
  1541. slash.Shape = "Ball"
  1542. slash.CanCollide = false
  1543. slash.FormFactor = "Custom"
  1544. slash.TopSurface = "Smooth"
  1545. slash.BottomSurface = "Smooth"
  1546. slash.BrickColor = BrickColor.Red()
  1547. slash.Size = Vector3.new(2,2,2)
  1548. slash.CFrame = root.CFrame * CFrame.new(0, 0, -3) * CFrame.Angles(0, 0, math.pi/2)
  1549. TouchedFunc = slash.Touched:connect(onProjectileTouched)
  1550.  
  1551. local bv = Instance.new("BodyVelocity")
  1552. bv.maxForce = Vector3.new(1e9, 1e9, 1e9)
  1553. bv.velocity = root.CFrame.lookVector * AttackProjectileSpeed
  1554. bv.Parent = slash
  1555.  
  1556. local spark = Instance.new("Fire")
  1557. spark.Color = slash.Color
  1558. spark.SecondaryColor = spark.Color
  1559. spark.Parent = slash
  1560.  
  1561. local light = Instance.new("PointLight")
  1562. light.Range = 16
  1563. light.Color = slash.Color
  1564. light.Parent = slash
  1565.  
  1566. slash.Parent = workspace
  1567. spawn(function()
  1568. local Proj = slash
  1569. local Fire = spark
  1570. local Att1 = Instance.new("Attachment",Proj) Att1.Position = Vector3.new(Proj.Size.Y/2,0,0)
  1571. local Att2 = Instance.new("Attachment",Proj) Att2.Position = Vector3.new(-Proj.Size.Y/2,0,0)
  1572. local Trail = Instance.new("Trail",Proj)
  1573. local TFunc = TouchedFunc
  1574. Trail.Attachment0 = Att1
  1575. Trail.Attachment1 = Att2
  1576. Trail.Color = ColorSequence.new(Color3.fromRGB(133,0,255),Color3.fromRGB(0,234,255))
  1577. Trail.Transparency = NumberSequence.new(0,1)
  1578. Trail.LightEmission = 1
  1579. Trail.FaceCamera = true
  1580. Trail.Lifetime = 1
  1581. Trail.MinLength = 0
  1582. local Light = light
  1583. wait(1)
  1584. TFunc:disconnect()
  1585. Proj.Transparency = 1
  1586. Proj.Anchored = true
  1587. local Expl = Instance.new("Explosion",workspace) Expl.Position = Proj.Position
  1588. Fire.Enabled = false
  1589. Light.Enabled = false
  1590. Trail.Enabled = false
  1591. game:GetService("Debris"):AddItem(Proj,5)
  1592. end)
  1593.  
  1594. AttackProjectileVictims = {}
  1595. spawn(function()
  1596. local S = Handle.Shot:Clone()
  1597. S.Parent = Handle
  1598. S.Pitch = 2
  1599. S:Stop()
  1600. S:Play()
  1601. game.Debris:AddItem(S,5)
  1602. end)
  1603. wait(0.25)
  1604. end
  1605.  
  1606. wait()
  1607. end
  1608. end
  1609. end
  1610.  
  1611. function onLeftDown()
  1612. if not SCooldown then
  1613. if not AttackAble then return end
  1614. AttackAble = false
  1615.  
  1616. if Humanoid and Humanoid.RigType == Enum.HumanoidRigType.R15 then
  1617. Remote:FireClient(getPlayer(), "PlayAnimation", "R15Swing1")
  1618. else
  1619. Remote:FireClient(getPlayer(), "PlayAnimation", "Swing1")
  1620. end
  1621.  
  1622.  
  1623. delay(0.2, function()
  1624. Handle.Swing.Pitch = 1
  1625. Handle.Swing:Play()
  1626. end)
  1627.  
  1628. delay(AttackWindupTime, function()
  1629. AttackVictims = {}
  1630. AttackDamaging = true
  1631. delay(AttackWindow, function()
  1632. AttackDamaging = false
  1633. end)
  1634. end)
  1635.  
  1636. LeftDown = true
  1637. local t = 0
  1638. while LeftDown do
  1639. t = t + Heartbeat:wait()
  1640. if t > AttackHoldTime then
  1641. onLeftHold()
  1642. break
  1643. end
  1644. end
  1645.  
  1646. delay(AttackRestTime, function()
  1647. AttackAble = true
  1648. end)
  1649. end
  1650. end
  1651.  
  1652. function onLeftUp()
  1653. LeftDown = false
  1654. end
  1655.  
  1656. function onRemote(player, func, ...)
  1657. if player ~= getPlayer() then return end
  1658.  
  1659. if func == "LeftDown" then
  1660. onLeftDown(...)
  1661. elseif func == "LeftUp" then
  1662. onLeftUp(...)
  1663. end
  1664. end
  1665.  
  1666. SCooldown = false
  1667. script.Parent.KeyPressed.OnServerEvent:connect(function(p,k,cd) --Detects keypresses.
  1668. if not SCooldown and AttackAble then
  1669. SCooldown = true
  1670. delay(cd,function()
  1671. SCooldown = false
  1672. end)
  1673. if k == 'e' then
  1674. if Humanoid and Humanoid.RigType == Enum.HumanoidRigType.R15 then
  1675. Remote:FireClient(getPlayer(), "PlayAnimation", "R15Swing2")
  1676. else
  1677. Remote:FireClient(getPlayer(), "PlayAnimation", "Swing2")
  1678. end
  1679.  
  1680. delay(0.1, function()
  1681. Handle.Swing.Pitch = 1
  1682. Handle.Swing:Play()
  1683. delay(0.4, function()
  1684. Handle.Swing.Pitch = 1.75
  1685. Handle.Swing:Play()
  1686. delay(0.3, function()
  1687. Handle.Swing.Pitch = 2.75
  1688. Handle.Swing:Play()
  1689. Handle.Shot.Pitch = 2
  1690. end)
  1691. end)
  1692. end)
  1693.  
  1694. wait(0.8)
  1695.  
  1696. local root = Tool.Parent:FindFirstChild("HumanoidRootPart")
  1697. if root then
  1698. for i = 1,5 do
  1699. for i = 1,3 do
  1700. local slash = Instance.new("Part")
  1701. slash.Material = "Neon"
  1702. slash.Shape = "Ball"
  1703. slash.CanCollide = false
  1704. slash.FormFactor = "Custom"
  1705. slash.TopSurface = "Smooth"
  1706. slash.BottomSurface = "Smooth"
  1707. slash.Color = BrickColor.Red()
  1708. slash.Size = Vector3.new(2,2,2)
  1709. slash.CFrame = root.CFrame * CFrame.new(-3 + ((i-1)*3), 0, -3) * CFrame.Angles(0, 0, math.pi/2)
  1710. TouchedFunc = slash.Touched:connect(onProjectileTouched)
  1711.  
  1712. local bv = Instance.new("BodyVelocity")
  1713. bv.maxForce = Vector3.new(1e9, 1e9, 1e9)
  1714. bv.velocity = root.CFrame.lookVector * AttackProjectileSpeed * 2
  1715. bv.Parent = slash
  1716.  
  1717. local spark = Instance.new("Fire")
  1718. spark.Color = slash.Color
  1719. spark.SecondaryColor = spark.Color
  1720. spark.Parent = slash
  1721.  
  1722. local light = Instance.new("PointLight")
  1723. light.Range = 16
  1724. light.Color = slash.Color
  1725. light.Parent = slash
  1726.  
  1727. slash.Parent = workspace
  1728. spawn(function()
  1729. local Proj = slash
  1730. local Fire = spark
  1731. local Att1 = Instance.new("Attachment",Proj) Att1.Position = Vector3.new(Proj.Size.Y/2,0,0)
  1732. local Att2 = Instance.new("Attachment",Proj) Att2.Position = Vector3.new(-Proj.Size.Y/2,0,0)
  1733. local Trail = Instance.new("Trail",Proj)
  1734. local TFunc = TouchedFunc
  1735. Trail.Attachment0 = Att1
  1736. Trail.Attachment1 = Att2
  1737. Trail.Color = ColorSequence.new(Color3.fromRGB(127,0,255),Color3.fromRGB(0,255,255))
  1738. Trail.Transparency = NumberSequence.new(0,1)
  1739. Trail.LightEmission = 1
  1740. Trail.FaceCamera = true
  1741. Trail.Lifetime = 1
  1742. Trail.MinLength = 0
  1743. local Light = light
  1744. wait(0.6)
  1745. TFunc:disconnect()
  1746. Proj.Transparency = 1
  1747. Proj.Anchored = true
  1748. local Expl = Instance.new("Explosion",workspace) Expl.Position = Proj.Position
  1749. Fire.Enabled = false
  1750. Light.Enabled = false
  1751. Trail.Enabled = false
  1752. game:GetService("Debris"):AddItem(Proj,5)
  1753. end)
  1754.  
  1755. AttackProjectileVictims = {}
  1756. spawn(function()
  1757. local S = Handle.Shot:Clone()
  1758. S.Parent = Handle
  1759. S.Pitch = 2.5
  1760. S:Stop()
  1761. S:Play()
  1762. game.Debris:AddItem(S,5)
  1763. end)
  1764. end
  1765. wait(0.08)
  1766. end
  1767.  
  1768. wait()
  1769. end
  1770. elseif k == 'q4' then
  1771. Character.Humanoid.WalkSpeed = 0
  1772. for i = 1,50 do
  1773. wait()
  1774. Handle.Parent.GripUp = Handle.Parent.GripUp + Vector3.new(i/50,0,0)
  1775. end
  1776. local BAV = Instance.new("BodyAngularVelocity",Handle)
  1777. BAV.MaxTorque = Vector3.new(5,5,5)
  1778. BAV.AngularVelocity = Vector3.new(0,0,0)
  1779. wait(0.1)
  1780. Handle.Engine:Play()
  1781. for i = 1,40 do
  1782. wait()
  1783. BAV.AngularVelocity = BAV.AngularVelocity + Vector3.new(0,0.8,0)
  1784. Handle.Engine.PlaybackSpeed = 1 + (4 * i/40)
  1785. end
  1786. wait(0.1)
  1787. local root = Tool.Parent:FindFirstChild("HumanoidRootPart")
  1788. if root then
  1789. for i = 1,100 do
  1790. local slash = Instance.new("Part")
  1791. slash.Material = "Neon"
  1792. slash.Shape = "Ball"
  1793. slash.CanCollide = false
  1794. slash.FormFactor = "Custom"
  1795. slash.TopSurface = "Smooth"
  1796. slash.BottomSurface = "Smooth"
  1797. slash.Color = BrickColor.Red()
  1798. slash.Size = Vector3.new(2,2,2)
  1799. slash.CFrame = root.CFrame * CFrame.new(0, 0, -3) * CFrame.Angles(0, 0, math.pi/2)
  1800. TouchedFunc = slash.Touched:connect(onProjectileTouched)
  1801.  
  1802. local bv = Instance.new("BodyVelocity")
  1803. bv.maxForce = Vector3.new(1e9, 1e9, 1e9)
  1804. bv.velocity = root.CFrame.lookVector * AttackProjectileSpeed * 2
  1805. bv.Parent = slash
  1806.  
  1807. local spark = Instance.new("Fire")
  1808. spark.Color = slash.Color
  1809. spark.SecondaryColor = spark.Color
  1810. spark.Parent = slash
  1811.  
  1812. local light = Instance.new("PointLight")
  1813. light.Range = 16
  1814. light.Color = slash.Color
  1815. light.Parent = slash
  1816.  
  1817. slash.Parent = workspace
  1818. spawn(function()
  1819. local Proj = slash
  1820. local Fire = spark
  1821. local Att1 = Instance.new("Attachment",Proj) Att1.Position = Vector3.new(Proj.Size.Y/2,0,0)
  1822. local Att2 = Instance.new("Attachment",Proj) Att2.Position = Vector3.new(-Proj.Size.Y/2,0,0)
  1823. local Trail = Instance.new("Trail",Proj)
  1824. local TFunc = TouchedFunc
  1825. Trail.Attachment0 = Att1
  1826. Trail.Attachment1 = Att2
  1827. Trail.Color = ColorSequence.new(Color3.fromRGB(127,0,255),Color3.fromRGB(0,255,255))
  1828. Trail.Transparency = NumberSequence.new(0,1)
  1829. Trail.LightEmission = 1
  1830. Trail.FaceCamera = true
  1831. Trail.Lifetime = 1
  1832. Trail.MinLength = 0
  1833. local Light = light
  1834. wait(0.6)
  1835. TFunc:disconnect()
  1836. Proj.Transparency = 1
  1837. Proj.Anchored = true
  1838. local Expl = Instance.new("Explosion",workspace) Expl.Position = Proj.Position
  1839. Fire.Enabled = false
  1840. Light.Enabled = false
  1841. Trail.Enabled = false
  1842. game:GetService("Debris"):AddItem(Proj,5)
  1843. end)
  1844.  
  1845. AttackProjectileVictims = {}
  1846. spawn(function()
  1847. local S = Handle.Shot:Clone()
  1848. S.Parent = Handle
  1849. S.Pitch = 2.5
  1850. S:Stop()
  1851. S:Play()
  1852. game.Debris:AddItem(S,5)
  1853. end)
  1854. wait()
  1855. end
  1856.  
  1857. wait()
  1858. end
  1859. for i = 1,40 do
  1860. wait()
  1861. BAV.AngularVelocity = BAV.AngularVelocity - Vector3.new(0,0.8,0)
  1862. Handle.Engine.PlaybackSpeed = 5 - (4 * i/40)
  1863. end
  1864. wait(0.5)
  1865. Handle.Engine:Stop()
  1866. BAV:Destroy()
  1867. Character.Humanoid.WalkSpeed = 16
  1868. Handle.Parent.GripPos = Vector3.new(0, -1, -0.55)
  1869. Handle.Parent.GripRight = Vector3.new(-1, 0, 0)
  1870. Handle.Parent.GripUp = Vector3.new(0, 0.894, -0.447)
  1871. Handle.Parent.GripForward = Vector3.new(0, 0.447, 0.894)
  1872. elseif k=='t4' then
  1873. Character.Humanoid.WalkSpeed = 0
  1874. local Particles = Handle.Storage.Footparticles:Clone()
  1875. Particles.Parent = Character.RightUpperArm
  1876. Particles.Enabled = true
  1877. local Particles2 = Handle.Storage.Footparticles:Clone()
  1878. Particles2.Parent = Character.RightUpperLeg
  1879. Particles2.Enabled = true
  1880. local BP = Instance.new("BodyPosition",Character.UpperTorso)
  1881. BP.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  1882. BP.Position = Character.UpperTorso.Position
  1883. spawn(function()
  1884. S = Handle.Swing:Clone()
  1885. S.Parent = Handle
  1886. S.Pitch = 1
  1887. S:Stop()
  1888. S:Play()
  1889. game.Debris:AddItem(S,5)
  1890. end)
  1891. for i = 1,10 do
  1892. wait()
  1893. S.Pitch = S.Pitch + 0.05
  1894. BP.Position = BP.Position + Vector3.new(0,5,0)
  1895. end
  1896. for i = 1,5 do
  1897. wait()
  1898. Handle.Mesh.Scale = Handle.Mesh.Scale - Vector3.new(0.4,0.4,0.4)
  1899. end
  1900. Tool.GripPos = Vector3.new(0,1,.55)
  1901. Tool.GripRight = Vector3.new(1,0,0)
  1902. for i = 1,5 do
  1903. wait()
  1904. Handle.Mesh.Scale = Handle.Mesh.Scale - Vector3.new(0.4,0.4,0.4)
  1905. end
  1906. wait(.75)
  1907. BP.D = 100
  1908. BP.P = 100000
  1909. spawn(function()
  1910. S = Handle.Swing:Clone()
  1911. S.Parent = Handle
  1912. S.Pitch = 1.5
  1913. S:Stop()
  1914. S:Play()
  1915. game.Debris:AddItem(S,5)
  1916. end)
  1917. for i = 1,10 do
  1918. wait()
  1919. S.Pitch = S.Pitch - 0.07
  1920. BP.Position = BP.Position - Vector3.new(0,5,0)
  1921. end
  1922. local Shockwave = Instance.new("Part",workspace)
  1923. Shockwave.Size = Vector3.new(25,25,25)
  1924. Shockwave.CanCollide = false
  1925. Shockwave.Anchored = true
  1926. Shockwave.Transparency = 0
  1927. Shockwave.CFrame = Character.UpperTorso.CFrame - Vector3.new(0,2.5,0)
  1928. Shockwave.Color = Color3.fromRGB(0,255,255)
  1929. game.Debris:AddItem(Shockwave,5)
  1930. TempCollision = Shockwave.Touched:connect(function(thing)
  1931. if thing.Parent:FindFirstChildOfClass("Humanoid") and thing.Parent.Name ~= Tool.Parent.Name then
  1932. thing.Parent.Humanoid.Health = 0
  1933. DeathMessage()
  1934. end
  1935. end)
  1936. local Mesh = Instance.new("SpecialMesh",Shockwave)
  1937. Mesh.MeshId = 'rbxassetid://20329976'
  1938. Mesh.Offset = Vector3.new(0,-5,0)
  1939. Mesh.Scale = Shockwave.Size
  1940. local Expl = Instance.new("Explosion",workspace) Expl.Position = Shockwave.Position - Vector3.new(0,5,0) Expl.BlastPressure = 0
  1941. Particles.Enabled = false
  1942. Particles2.Enabled = false
  1943. game.Debris:AddItem(Particles,5)
  1944. game.Debris:AddItem(Particles2,5)
  1945. spawn(function()
  1946. local S = Handle.Shot:Clone()
  1947. S.Parent = Handle
  1948. S.Pitch = .8
  1949. S:Stop()
  1950. S:Play()
  1951. game.Debris:AddItem(S,5)
  1952. end)
  1953. spawn(function()
  1954. for i = 1,20 do
  1955. wait()
  1956. Shockwave.Transparency = Shockwave.Transparency + 0.05
  1957. Mesh.Scale = Mesh.Scale + Vector3.new(4,4*(10/25),4)
  1958. end
  1959. end)
  1960. wait(0.1)
  1961. TempCollision:disconnect()
  1962. for i = 1,5 do
  1963. wait()
  1964. Handle.Mesh.Scale = Handle.Mesh.Scale + Vector3.new(0.4,0.4,0.4)
  1965. end
  1966. Tool.GripPos = Vector3.new(0,-1,-.55)
  1967. Tool.GripRight = Vector3.new(-1,0,0)
  1968. for i = 1,5 do
  1969. wait()
  1970. Handle.Mesh.Scale = Handle.Mesh.Scale + Vector3.new(0.4,0.4,0.4)
  1971. end
  1972. wait(0.5)
  1973. BP:Destroy()
  1974. Handle.Mesh.Scale = Vector3.new(2,2,2)
  1975. Character.Humanoid.WalkSpeed = 16
  1976. end
  1977. end
  1978. end)
  1979.  
  1980. function box(text)
  1981. if Character.Head:FindFirstChild("BillboardGui") then
  1982. Character.Head.BillboardGui:Destroy()
  1983. end
  1984. local GUI = Instance.new("BillboardGui",Character.Head) GUI.Size = UDim2.new(0,3000,0,30) GUI.LightInfluence = 0 GUI.StudsOffset = Vector3.new(0,1.65,0) GUI.AlwaysOnTop = true
  1985. local TL = Instance.new("TextLabel",GUI) TL.Size = UDim2.new(1,0,1,0) TL.BorderSizePixel = 0 TL.BackgroundTransparency = 1 TL.TextStrokeColor3 = Color3.fromRGB(127,0,255) TL.TextStrokeTransparency = 0 TL.TextColor3 = Color3.new(0,0,0) TL.TextScaled = true TL.Text = tostring(text) TL.Font = "SciFi"
  1986. delay(1.5,function()
  1987. for i = 1,60 do
  1988. wait()
  1989. TL.TextTransparency = i/20
  1990. TL.TextStrokeTransparency = (i-20)/40
  1991. end
  1992. GUI:Destroy()
  1993. end)
  1994. end
  1995.  
  1996. script.Parent.MiscFuncs.OnServerEvent:connect(function(p,t,a)
  1997. if t=='box' then
  1998. box(a)
  1999. elseif t=='musid' then
  2000. Handle.Mus.SoundId = 'rbxassetid://' .. tonumber(a)
  2001. Handle.Mus:Play()
  2002. elseif t=='togglemus' then
  2003. if Handle.Mus.IsPlaying then
  2004. Handle.Mus:Stop()
  2005. else
  2006. Handle.Mus:Play()
  2007. end
  2008. elseif t=='vol' then
  2009. Handle.Mus.Volume = tonumber(a)
  2010. elseif t=='resetvol' then
  2011. Handle.Mus.Volume = 1
  2012. elseif t=='pit' then
  2013. Handle.Mus.PlaybackSpeed = tonumber(a)
  2014. elseif t=='resetpit' then
  2015. Handle.Mus.PlaybackSpeed = 1
  2016. elseif t=='psh' then
  2017. Handle.Mus.PS.Octave = tonumber(a)
  2018. Handle.Mus.PS.Enabled = true
  2019. elseif t=='togglepsh' then
  2020. Handle.Mus.PS.Enabled = not Handle.Mus.PS.Enabled
  2021. elseif t=='dis' then
  2022. Handle.Mus.D.Level = tonumber(a)
  2023. Handle.Mus.D.Enabled = true
  2024. elseif t=='toggledis' then
  2025. Handle.Mus.D.Enabled = not Handle.Mus.D.Enabled
  2026. end
  2027. end)
  2028.  
  2029. Remote.OnServerEvent:connect(onRemote)
  2030. Handle.Touched:connect(onHandleTouched)
  2031. Tool.Equipped:Connect(function()
  2032. Character = Tool.Parent
  2033. Humanoid = Character:FindFirstChildOfClass("Humanoid")
  2034. script.Parent.Equip.Value = true
  2035. script.Parent.BindKeys.Disabled = false
  2036. if BackScythe then
  2037. BackScythe:Destroy()
  2038. end
  2039. end)
  2040.  
  2041. Tool.Unequipped:Connect(function()
  2042. script.Parent.Equip.Value = false
  2043. Handle.Mus:Stop()
  2044. BackScythe = Handle:Clone()
  2045. BackScythe.Parent = Character
  2046. BackScythe.Name = "BackScythe"
  2047. BackScythe.CanCollide = false
  2048. for _,v in pairs(BackScythe:GetChildren()) do
  2049. if not v:IsA("SpecialMesh") then
  2050. v:Destroy()
  2051. end
  2052. end
  2053. BackScythe.Mesh.Scale = Vector3.new(1.25, 1.25, 1.25)
  2054. AutoWeld(BackScythe,Character.UpperTorso,CFrame.new(.55,-.15,-.15) * CFrame.Angles(0,math.rad(-90),math.rad(-25)))
  2055. Character = nil
  2056. Humanoid = nil
  2057. end)
  2058. end))
  2059. Script76.Parent = Tool0
  2060. table.insert(cors,sandbox(Script76,function()
  2061. while true do
  2062. wait(0.2)
  2063.  
  2064.  
  2065. end
  2066. end))
  2067. BindableEvent77.Name = "MouseDown"
  2068. BindableEvent77.Parent = Tool0
  2069. Part78.Name = "Handle"
  2070. Part78.Parent = Tool0
  2071. Part78.Material = Enum.Material.Metal
  2072. Part78.BrickColor = BrickColor.new("Really blue")
  2073. Part78.Transparency = 1
  2074. Part78.Rotation = Vector3.new(90, -88, 6)
  2075. Part78.Anchored = true
  2076. Part78.CanCollide = false
  2077. Part78.Size = Vector3.new(0.13984479, 2.09378719, 0.149556234)
  2078. Part78.CFrame = CFrame.new(-18.5061989, 1.79165411, -16.7970867, 0.0347090028, -0.00364701357, -0.9993909, -0.993916094, 0.104464389, -0.0349000804, 0.104528017, 0.994522035, 1.02913452e-06)
  2079. Part78.BottomSurface = Enum.SurfaceType.Smooth
  2080. Part78.TopSurface = Enum.SurfaceType.Smooth
  2081. Part78.Color = Color3.new(0, 0, 1)
  2082. Part78.Position = Vector3.new(-18.5061989, 1.79165411, -16.7970867)
  2083. Part78.Orientation = Vector3.new(2, -90, -84)
  2084. Part78.Color = Color3.new(0, 0, 1)
  2085. Sound79.Name = "HitSound"
  2086. Sound79.Parent = Part78
  2087. Sound79.SoundId = "http://www.roblox.com/asset/?id=247718165"
  2088. Sound79.Volume = 1
  2089. Sound80.Name = "LungeSound"
  2090. Sound80.Parent = Part78
  2091. Sound80.Pitch = 0.80000001192093
  2092. Sound80.SoundId = "rbxassetid://935843979"
  2093. Sound80.Volume = 1
  2094. Sound81.Name = "OverheadSound"
  2095. Sound81.Parent = Part78
  2096. Sound81.Pitch = 1.1699999570847
  2097. Sound81.SoundId = "rbxassetid://210946558"
  2098. Sound81.Volume = 3
  2099. Sound82.Name = "SlashSound"
  2100. Sound82.Parent = Part78
  2101. Sound82.SoundId = "rbxassetid://260430015"
  2102. Sound82.Volume = 1
  2103. Sound83.Name = "UnsheathSound"
  2104. Sound83.Parent = Part78
  2105. Sound83.SoundId = "rbxassetid://260411317"
  2106. Sound83.Volume = 3
  2107. Sound84.Name = "deactivate"
  2108. Sound84.Parent = Part78
  2109. Sound84.Pitch = 0.5
  2110. Sound84.SoundId = "rbxassetid://260411317"
  2111. Sound84.Volume = 5
  2112. Sound85.Name = "Fire"
  2113. Sound85.Parent = Part78
  2114. Sound85.Pitch = 2
  2115. Sound85.SoundId = "rbxassetid://366825104"
  2116. Sound85.Volume = 3
  2117. Sound86.Name = "BigSlash"
  2118. Sound86.Parent = Part78
  2119. Sound86.Pitch = 0.69999998807907
  2120. Sound86.SoundId = "rbxassetid://186936370"
  2121. Sound86.Volume = 1
  2122. Sound87.Name = "Blood"
  2123. Sound87.Parent = Part78
  2124. Sound87.Pitch = 0.5
  2125. Sound87.SoundId = "rbxassetid://96667969"
  2126. Sound87.TimePosition = 0.05
  2127. Sound87.Volume = 1
  2128. Sound88.Name = "Hit"
  2129. Sound88.Parent = Part78
  2130. Sound88.Pitch = 0.5
  2131. Sound88.SoundId = "rbxassetid://96667969"
  2132. Sound88.TimePosition = 0.05
  2133. Sound88.Volume = 2
  2134. Sound89.Parent = Part78
  2135. Sound89.SoundId = "rbxasset://sounds/SwordSlash.wav"
  2136. Sound89.Volume = 1
  2137. Sound90.Name = "Swing"
  2138. Sound90.Parent = Part78
  2139. Sound90.SoundId = "rbxassetid://169310429"
  2140. Sound90.Volume = 1
  2141. Sound91.Name = "SwingSpecial"
  2142. Sound91.Parent = Part78
  2143. Sound91.Pitch = 1.2000000476837
  2144. Sound91.SoundId = "rbxassetid://169310429"
  2145. Sound91.Volume = 1
  2146. Fire92.Parent = Part78
  2147. Fire92.Color = Color3.new(0.92549, 0.545098, 0.27451)
  2148. Fire92.Enabled = false
  2149. Fire92.Color = Color3.new(0.92549, 0.545098, 0.27451)
  2150. Script93.Name = "SpecialDamage"
  2151. Script93.Parent = Part78
  2152. Script93.Disabled = true
  2153. table.insert(cors,sandbox(Script93,function()
  2154. function onTouched(part)
  2155. local h = part.Parent:findFirstChild("Humanoid")
  2156. if h~=nil then
  2157. h.Health = h.Health -30 -- plus 10 damage
  2158. script.Disabled = true
  2159. script.Parent.Hit:Play()
  2160. -- script.Parent.Fire.Enabled = false
  2161. if h.Health == 0 then
  2162. print("Killed Player")
  2163. end
  2164. local m = math.random(1,11)
  2165.  
  2166. if m == 1 then -- bleeding effect
  2167.  
  2168. script.Parent.Blood:Play()
  2169. print("Blood")
  2170. h.Health = h.Health -5
  2171. wait(1)
  2172. print("-3 health")
  2173. h.Health = h.Health -3
  2174. wait(0.5)
  2175. print("-3 health")
  2176. h.Health = h.Health -3
  2177. wait(0.5)
  2178. print("-3 health")
  2179. h.Health = h.Health -3
  2180. wait(0.5)
  2181. print("-3 health")
  2182. h.Health = h.Health -3
  2183. wait(0.5)
  2184. print("-3 health")
  2185. h.Health = h.Health -3
  2186. wait(0.5)
  2187. print("-3 health")
  2188. h.Health = h.Health -3
  2189. end
  2190. if m == 2 then
  2191. print("*Critical Hit*")
  2192. h.Health = h.Health -40 -- Gives a damage boost
  2193. script.Parent.BigSlash:Play()
  2194.  
  2195. end
  2196. if m == 3 then
  2197. print("Clean Cut")
  2198. h.Health = h.Health -20
  2199. h.PlatformStand = true
  2200. h.WalkSpeed = 12
  2201. h.JumpPower = 0
  2202. wait(0.5)
  2203. h.PlatformStand = false
  2204. wait(9.5)
  2205. h.JumpPower = 50
  2206. h.WalkSpeed = 16
  2207. end
  2208. if m == 4 then
  2209. print("Broken Armor")
  2210. h.MaxHealth = 50
  2211. wait()
  2212. h.Health = h.Health -20
  2213. wait(10)
  2214. h.MaxHealth = 100
  2215.  
  2216. end
  2217. if m == 5 then
  2218. print("Hit")
  2219. h.Health = h.Health -15
  2220. end
  2221. if m == 6 then
  2222. h.Health = h.Health -10
  2223. print("Hit")
  2224. end
  2225. if m == 7 then
  2226. print("Hit")
  2227. h.Health = h.Health -25
  2228. end
  2229. if m == 8 then
  2230. print("Hit")
  2231. h.Health = h.Health -20
  2232. end
  2233. if m == 9 then
  2234. print("Broken Armor")
  2235. h.MaxHealth = 50
  2236. wait()
  2237. h.Health = h.Health -20
  2238. wait(10)
  2239. h.MaxHealth = 100
  2240.  
  2241. end
  2242. if m == 10 then
  2243. script.Parent.Blood:Play()
  2244. print("Blood")
  2245. h.Health = h.Health -5
  2246. wait(1)
  2247. print("-3 health")
  2248. h.Health = h.Health -3
  2249. wait(0.5)
  2250. print("-3 health")
  2251. h.Health = h.Health -3
  2252. wait(0.5)
  2253. print("-3 health")
  2254. h.Health = h.Health -3
  2255. wait(0.5)
  2256. print("-3 health")
  2257. h.Health = h.Health -3
  2258. wait(0.5)
  2259. print("-3 health")
  2260. h.Health = h.Health -3
  2261. wait(0.5)
  2262. print("-3 health")
  2263. h.Health = h.Health -3
  2264. end
  2265. if m == 11 then
  2266. print("Hit")
  2267. h.Health = h.Health -15
  2268. end
  2269.  
  2270.  
  2271.  
  2272. end
  2273. end
  2274.  
  2275. script.Parent.Touched:connect(onTouched)
  2276. end))
  2277. Script94.Name = "SwordEffect"
  2278. Script94.Parent = Part78
  2279. Script94.Disabled = true
  2280. table.insert(cors,sandbox(Script94,function()
  2281. function onTouched(part)
  2282. local h = part.Parent:findFirstChild("Humanoid")
  2283. if h~=nil then
  2284. h.Health = h.Health -12 -- plus 10 damage
  2285. script.Disabled = true
  2286. script.Parent.Hit:Play()
  2287. -- script.Parent.Fire.Enabled = false
  2288. if h.Health == 0 then
  2289. print("Killed Player")
  2290. end
  2291. local m = math.random(1,11)
  2292.  
  2293. if m == 1 then -- bleeding effect
  2294.  
  2295. script.Parent.Blood:Play()
  2296. print("Blood")
  2297. h.Health = h.Health -5
  2298. wait(1)
  2299. print("-3 health")
  2300. h.Health = h.Health -3
  2301. wait(0.5)
  2302. print("-3 health")
  2303. h.Health = h.Health -3
  2304. wait(0.5)
  2305. print("-3 health")
  2306. h.Health = h.Health -3
  2307. wait(0.5)
  2308. print("-3 health")
  2309. h.Health = h.Health -3
  2310. wait(0.5)
  2311. print("-3 health")
  2312. h.Health = h.Health -3
  2313. wait(0.5)
  2314. print("-3 health")
  2315. h.Health = h.Health -3
  2316. end
  2317. if m == 2 then
  2318. print("*Critical Hit*")
  2319. h.Health = h.Health -32 -- Gives a damage boost
  2320. script.Parent.BigSlash:Play()
  2321.  
  2322. end
  2323. if m == 3 then
  2324. print("Clean Cut")
  2325. h.Health = h.Health -32
  2326. h.PlatformStand = true
  2327. h.WalkSpeed = 12
  2328. h.JumpPower = 0
  2329. wait(0.5)
  2330. h.PlatformStand = false
  2331. wait(9.5)
  2332. h.JumpPower = 50
  2333. h.WalkSpeed = 16
  2334. end
  2335. if m == 4 then
  2336. print("Broken Armor")
  2337. h.MaxHealth = 65
  2338. wait()
  2339. h.Health = h.Health -20
  2340. wait(10)
  2341. h.MaxHealth = 100
  2342.  
  2343. end
  2344. if m == 5 then
  2345. print("Hit")
  2346. h.Health = h.Health -12
  2347. end
  2348. if m == 6 then
  2349. h.Health = h.Health -12
  2350. print("Hit")
  2351. end
  2352. if m == 7 then
  2353. print("Hit")
  2354. h.Health = h.Health -25
  2355. end
  2356. if m == 8 then
  2357. print("Hit")
  2358. h.Health = h.Health -20
  2359. end
  2360. if m == 9 then
  2361. print("Broken Armor")
  2362. h.MaxHealth = 50
  2363. wait()
  2364. h.Health = h.Health -20
  2365. wait(10)
  2366. h.MaxHealth = 100
  2367.  
  2368. end
  2369. if m == 10 then
  2370. script.Parent.Blood:Play()
  2371. print("Blood")
  2372. h.Health = h.Health -5
  2373. wait(1)
  2374. print("-3 health")
  2375. h.Health = h.Health -3
  2376. wait(0.5)
  2377. print("-3 health")
  2378. h.Health = h.Health -3
  2379. wait(0.5)
  2380. print("-3 health")
  2381. h.Health = h.Health -3
  2382. wait(0.5)
  2383. print("-3 health")
  2384. h.Health = h.Health -3
  2385. wait(0.5)
  2386. print("-3 health")
  2387. h.Health = h.Health -3
  2388. wait(0.5)
  2389. print("-3 health")
  2390. h.Health = h.Health -3
  2391. end
  2392. if m == 11 then
  2393. print("Hit")
  2394. h.Health = h.Health -15
  2395. end
  2396.  
  2397.  
  2398.  
  2399. end
  2400. end
  2401.  
  2402. script.Parent.Touched:connect(onTouched)
  2403. end))
  2404. Sound95.Name = "PowerUp"
  2405. Sound95.Parent = Part78
  2406. Sound95.SoundId = "rbxassetid://520231478"
  2407. Sound96.Name = "Engine"
  2408. Sound96.Parent = Part78
  2409. Sound96.SoundId = "rbxassetid://143350696"
  2410. Sound96.Looped = true
  2411. Sound97.Name = "Mus"
  2412. Sound97.Parent = Part78
  2413. Sound97.Volume = 0
  2414. Sound97.Looped = true
  2415. Sound98.Name = "Shot"
  2416. Sound98.Parent = Part78
  2417. Sound98.SoundId = "rbxassetid://157878578"
  2418. Folder99.Name = "Storage"
  2419. Folder99.Parent = Part78
  2420. ParticleEmitter100.Name = "Footparticles"
  2421. ParticleEmitter100.Parent = Folder99
  2422. ParticleEmitter100.Transparency = NumberSequence.new(0,0,1)
  2423. ParticleEmitter100.Size = NumberSequence.new(0.10000000149012,0.10000000149012)
  2424. ParticleEmitter100.Color = ColorSequence.new(Color3.new(0, 1, 1),Color3.new(0, 1, 1))
  2425. ParticleEmitter100.Enabled = false
  2426. ParticleEmitter100.LightEmission = 1
  2427. ParticleEmitter100.Acceleration = Vector3.new(0, 0.100000001, 0)
  2428. ParticleEmitter100.Lifetime = NumberRange.new(2, 2)
  2429. ParticleEmitter100.Rate = 100
  2430. ParticleEmitter100.Speed = NumberRange.new(3, 3)
  2431. ParticleEmitter100.VelocitySpread = 20
  2432. ParticleEmitter100.Color = ColorSequence.new(Color3.new(0, 1, 1),Color3.new(0, 1, 1))
  2433. Sound101.Name = "Swing"
  2434. Sound101.Parent = Part78
  2435. Sound101.SoundId = "rbxassetid://168615093"
  2436. Sound101.Volume = 1
  2437. SpecialMesh102.Parent = Part78
  2438. SpecialMesh102.MeshId = "rbxassetid://32"
  2439. SpecialMesh102.Scale = Vector3.new(2, 2, 2)
  2440. SpecialMesh102.TextureId = "rbxassetid://845822608"
  2441. SpecialMesh102.VertexColor = Vector3.new(0.649999976, 0, 1)
  2442. SpecialMesh102.MeshType = Enum.MeshType.FileMesh
  2443. SpecialMesh102.Scale = Vector3.new(2, 2, 2)
  2444. Animation103.Name = "SwingAnim2"
  2445. Animation103.Parent = Tool0
  2446. Animation103.AnimationId = "rbxassetid://846744780"
  2447. Script104.Name = "All animations"
  2448. Script104.Parent = Animation103
  2449. table.insert(cors,sandbox(Script104,function()
  2450. while true do
  2451. script.Parent.AnimationId="http://www.roblox.com/Asset?ID=86313418"
  2452. wait(0.001)--Default swing1
  2453. script.Parent.AnimationId="http://www.roblox.com/Asset?ID=86313260"
  2454. wait(0.001)--Default swing2
  2455. end
  2456. end))
  2457. LocalScript105.Name = "Special"
  2458. LocalScript105.Parent = Tool0
  2459. LocalScript105.Disabled = true
  2460. table.insert(cors,sandbox(LocalScript105,function()
  2461. local Tool = script.Parent
  2462. local Staff = Tool.Handle
  2463.  
  2464. local vCharacter
  2465. local myHumanoid
  2466.  
  2467.  
  2468. local animate
  2469.  
  2470. local slamAnim
  2471. local swingAnim2
  2472. function onEquipped(mouse)
  2473. vCharacter = Tool.Parent
  2474. myHumanoid = vCharacter:FindFirstChild("Humanoid")
  2475.  
  2476. if mouse then
  2477. mouse.KeyDown:connect(function(key)
  2478. if key:lower() == "f" and myHumanoid then
  2479. animate = Tool:FindFirstChild("Animate")
  2480. swingAnim2 = myHumanoid:LoadAnimation(Tool.SwingAnim2)
  2481. if swingAnim2 then swingAnim2:Play() end
  2482. Staff.SwingSpecial:Play()
  2483. script.Settings.CoolDown.Value = script.Settings.CoolDown.Value -1
  2484.  
  2485. script.Timer.Disabled = false
  2486. script.Disabled = true
  2487. script.Parent.Handle.SpecialDamage.Disabled = false
  2488.  
  2489.  
  2490.  
  2491. lol = script.Parent.Parent.UpperTorso
  2492. lol.Velocity = script.Parent.Parent.Head.CFrame.lookVector * 200 -- Foward Dash
  2493. wait(0.1)
  2494. lol.Velocity = script.Parent.Parent.Head.CFrame.lookVector * 180 -- Foward Dash
  2495. wait(0.1)
  2496. lol.Velocity = script.Parent.Parent.Head.CFrame.lookVector * 300 -- Foward Dash
  2497. wait(0.1)
  2498. script.Parent.Handle.SpecialDamage.Disabled = true
  2499. wait(15)
  2500. wait(12)
  2501.  
  2502. end
  2503. end)
  2504. end
  2505. end
  2506.  
  2507. function onUnequipped()
  2508. if slamAnim then slamAnim:Stop() end
  2509. if swingAnim2 then swingAnim2:Stop() end
  2510. end
  2511.  
  2512. Tool.Equipped:connect(onEquipped)
  2513. Tool.Unequipped:connect(onUnequipped)
  2514.  
  2515. animate = Tool:FindFirstChild("Animate")
  2516. while animate == nil do
  2517. animate = Tool:FindFirstChild("Animate")
  2518. wait()
  2519. end
  2520.  
  2521. animate.Changed:connect(function()
  2522. animate = Tool:FindFirstChild("Animate")
  2523. if animate and animate.Value == 1 and myHumanoid then
  2524. slamAnim = myHumanoid:LoadAnimation(Tool.SlamAnim)
  2525. if slamAnim then slamAnim:Play() end
  2526. myHumanoid.Jump = true
  2527. wait(2.2)
  2528. animate.Value = 0
  2529. end
  2530. end)
  2531.  
  2532. --Tool.GripUp = Vector3.new(0, 0.2, -0.8)
  2533. --wait(0.0001)
  2534. --Tool.GripUp = Vector3.new(0, 0.4, -0.6)
  2535. --wait(0.0001)
  2536. --Tool.GripUp = Vector3.new(0, 0.6, -0.4)
  2537. --wait(0.0001)
  2538. --Tool.GripUp = Vector3.new(0, 0.8, -0.2)
  2539. --wait(0.0001)
  2540. --Tool.GripUp = Vector3.new(0, 1, -0.0)
  2541. --wait(0.0001)
  2542. --Tool.GripUp = Vector3.new(0, 0.8, 0.2)
  2543. --wait(0.0001)
  2544. --Tool.GripUp = Vector3.new(0, 0.6, 0.4)
  2545. --wait(0.0001)
  2546. --Tool.GripUp = Vector3.new(0, 0.4, 0.6)
  2547. -- wait(0.0001)
  2548. -- Tool.GripUp = Vector3.new(0, 0.2, 0.8)
  2549. -- wait(0.0001)
  2550. -- Tool.GripUp = Vector3.new(0, 0.0, 1)
  2551. -- wait(0.0001)
  2552. -- Tool.GripUp = Vector3.new(0.0, -0.2, 0.8)
  2553. -- wait(0.0001)
  2554. -- Tool.GripUp = Vector3.new(0, -0.4, 0.6)
  2555. -- wait(0.0001)
  2556. -- Tool.GripUp = Vector3.new(0.0, -0.6, 0.4)
  2557. -- wait(0.0001)
  2558. -- Tool.GripUp = Vector3.new(0, -0.8, 0.2)
  2559. -- wait(0.0001)
  2560. -- Tool.GripUp = Vector3.new(0.0, -1, 0.0)
  2561. -- wait(0.0001)
  2562. -- Tool.GripUp = Vector3.new(0, -0.8, -0.2)
  2563. -- wait(0.0001)
  2564. -- Tool.GripUp = Vector3.new(0, -0.6, -0.4)
  2565. -- wait(0.0001)
  2566. -- Tool.GripUp = Vector3.new(0, -0.4, -0.6)
  2567. -- wait(0.0001)
  2568. -- Tool.GripUp = Vector3.new(0, -0.2, -0.8)
  2569. -- wait(0.0001)
  2570. -- Tool.GripUp = Vector3.new(0, 0, -1)
  2571. -- wait(0.0001)
  2572.  
  2573. --Full loop around
  2574.  
  2575. end))
  2576. Folder106.Name = "Settings"
  2577. Folder106.Parent = LocalScript105
  2578. NumberValue107.Name = "CoolDown"
  2579. NumberValue107.Parent = Folder106
  2580. Script108.Name = "Timer"
  2581. Script108.Parent = LocalScript105
  2582. table.insert(cors,sandbox(Script108,function()
  2583. while true do
  2584. wait(1)
  2585. script.Parent.Parent.Special.Disabled = false
  2586. script.Parent.Settings.CoolDown.Value = script.Parent.Settings.CoolDown.Value +1
  2587.  
  2588. wait(6)
  2589. end
  2590.  
  2591.  
  2592. end))
  2593. Animation109.Name = "Swing2"
  2594. Animation109.Parent = Tool0
  2595. Animation109.AnimationId = "rbxassetid://218508052"
  2596. BoolValue110.Name = "Equip"
  2597. BoolValue110.Parent = Tool0
  2598. Model111.Parent = Tool0
  2599. Part112.Parent = Model111
  2600. Part112.Rotation = Vector3.new(34.4199982, 86.9199982, 44.4199982)
  2601. Part112.Anchored = true
  2602. Part112.Size = Vector3.new(1.01603687, 2.41721296, 0.113708258)
  2603. Part112.CFrame = CFrame.new(-18.6229935, 2.42044735, -13.5100183, 0.0383460782, -0.0375720412, 0.998557925, 0.980508804, 0.194123685, -0.0303487312, -0.1927035, 0.980258644, 0.0442834869)
  2604. Part112.BottomSurface = Enum.SurfaceType.Smooth
  2605. Part112.TopSurface = Enum.SurfaceType.Smooth
  2606. Part112.Position = Vector3.new(-18.6229935, 2.42044735, -13.5100183)
  2607. Part112.Orientation = Vector3.new(1.74000001, 87.4599991, 78.7999954)
  2608. Part113.Parent = Model111
  2609. Part113.Rotation = Vector3.new(34.4199982, 86.9199982, 58.4199982)
  2610. Part113.Anchored = true
  2611. Part113.Size = Vector3.new(1.17376089, 0.0843640491, 0.388808399)
  2612. Part113.CFrame = CFrame.new(-18.6818218, 2.59582543, -12.4360409, 0.0281175356, -0.0457327552, 0.998557925, 0.998346329, -0.048849199, -0.0303487312, 0.0501666851, 0.997760057, 0.0442834869)
  2613. Part113.BottomSurface = Enum.SurfaceType.Smooth
  2614. Part113.TopSurface = Enum.SurfaceType.Smooth
  2615. Part113.Position = Vector3.new(-18.6818218, 2.59582543, -12.4360409)
  2616. Part113.Orientation = Vector3.new(1.74000001, 87.4599991, 92.7999954)
  2617. WedgePart114.Parent = Model111
  2618. WedgePart114.Rotation = Vector3.new(92.8799973, -1.61000001, 2.61999989)
  2619. WedgePart114.Anchored = true
  2620. WedgePart114.Size = Vector3.new(0.10270486, 1.38650477, 1.04171228)
  2621. WedgePart114.CFrame = CFrame.new(-18.8054695, 2.4710958, -9.37263298, 0.998557746, -0.0457364321, -0.0281177275, -0.0303489957, -0.0488492735, -0.998350024, 0.0442869887, 0.997763574, -0.0501668751)
  2622. WedgePart114.BottomSurface = Enum.SurfaceType.Smooth
  2623. WedgePart114.Position = Vector3.new(-18.8054695, 2.4710958, -9.37263298)
  2624. WedgePart114.Orientation = Vector3.new(86.7099991, -150.729996, -148.149994)
  2625. Part115.Parent = Model111
  2626. Part115.Rotation = Vector3.new(34.4199982, 86.9199982, 58.4199982)
  2627. Part115.Anchored = true
  2628. Part115.Size = Vector3.new(1.01603687, 2.41721296, 0.113708258)
  2629. Part115.CFrame = CFrame.new(-18.7183228, 2.55116248, -11.2708569, 0.0281176046, -0.0457328707, 0.998557925, 0.998348832, -0.0488493219, -0.0303487331, 0.0501668118, 0.997762561, 0.0442834869)
  2630. Part115.BottomSurface = Enum.SurfaceType.Smooth
  2631. Part115.TopSurface = Enum.SurfaceType.Smooth
  2632. Part115.Position = Vector3.new(-18.7183228, 2.55116248, -11.2708569)
  2633. Part115.Orientation = Vector3.new(1.74000001, 87.4599991, 92.7999954)
  2634. Part116.Parent = Model111
  2635. Part116.Rotation = Vector3.new(34.4199982, 86.9199982, 72.4199982)
  2636. Part116.Anchored = true
  2637. Part116.Size = Vector3.new(0.209076971, 0.674912453, 0.172396347)
  2638. Part116.CFrame = CFrame.new(-18.5111561, 1.8480581, -16.5891514, 0.0162189938, -0.0511819907, 0.998557627, 0.956872523, -0.288918257, -0.0303506926, 0.290054828, 0.955984712, 0.04428868)
  2639. Part116.BottomSurface = Enum.SurfaceType.Smooth
  2640. Part116.TopSurface = Enum.SurfaceType.Smooth
  2641. Part116.Position = Vector3.new(-18.5111561, 1.8480581, -16.5891514)
  2642. Part116.Orientation = Vector3.new(1.74000001, 87.4599991, 106.799995)
  2643. Part117.Parent = Model111
  2644. Part117.Rotation = Vector3.new(34.4199982, 86.9199982, 65.4199982)
  2645. Part117.Anchored = true
  2646. Part117.Size = Vector3.new(0.220080972, 1.1407485, 0.172396347)
  2647. Part117.CFrame = CFrame.new(-18.4710484, 2.02445006, -17.3725452, 0.0223356374, -0.0488238782, 0.998557627, 0.984950542, -0.170150787, -0.0303506926, 0.171387121, 0.984207809, 0.04428868)
  2648. Part117.BottomSurface = Enum.SurfaceType.Smooth
  2649. Part117.TopSurface = Enum.SurfaceType.Smooth
  2650. Part117.Position = Vector3.new(-18.4710484, 2.02445006, -17.3725452)
  2651. Part117.Orientation = Vector3.new(1.74000001, 87.4599991, 99.7999954)
  2652. Part118.Parent = Model111
  2653. Part118.Rotation = Vector3.new(34.4199982, 86.9199982, 44.4199982)
  2654. Part118.Anchored = true
  2655. Part118.Size = Vector3.new(1.17376089, 0.0183400121, 0.388808399)
  2656. Part118.CFrame = CFrame.new(-18.594883, 2.17552924, -14.6840286, 0.0383490361, -0.0375766307, 0.998557627, 0.980507076, 0.194125444, -0.0303506926, -0.192705095, 0.980256796, 0.04428868)
  2657. Part118.BottomSurface = Enum.SurfaceType.Smooth
  2658. Part118.TopSurface = Enum.SurfaceType.Smooth
  2659. Part118.Position = Vector3.new(-18.594883, 2.17552924, -14.6840286)
  2660. Part118.Orientation = Vector3.new(1.74000001, 87.4599991, 78.7999954)
  2661. Part119.Parent = Model111
  2662. Part119.Rotation = Vector3.new(34.4199982, 86.9199982, 37.4199982)
  2663. Part119.Anchored = true
  2664. Part119.Size = Vector3.new(0.220080972, 1.1407485, 0.172396347)
  2665. Part119.CFrame = CFrame.new(-18.5442772, 1.92975199, -15.786396, 0.0426426232, -0.0326229893, 0.998557627, 0.949540734, 0.312171906, -0.0303506926, -0.310731679, 0.949465394, 0.04428868)
  2666. Part119.BottomSurface = Enum.SurfaceType.Smooth
  2667. Part119.TopSurface = Enum.SurfaceType.Smooth
  2668. Part119.Position = Vector3.new(-18.5442772, 1.92975199, -15.786396)
  2669. Part119.Orientation = Vector3.new(1.74000001, 87.4599991, 71.7999954)
  2670. Part120.Parent = Model111
  2671. Part120.Rotation = Vector3.new(34.4199982, 86.9199982, 44.4199982)
  2672. Part120.Anchored = true
  2673. Part120.Size = Vector3.new(0.209076971, 0.674912453, 0.172396347)
  2674. Part120.CFrame = CFrame.new(-18.5721951, 2.14209223, -15.0114365, 0.0383490361, -0.0375766307, 0.998557627, 0.980507076, 0.194125444, -0.0303506926, -0.192705095, 0.980256796, 0.04428868)
  2675. Part120.BottomSurface = Enum.SurfaceType.Smooth
  2676. Part120.TopSurface = Enum.SurfaceType.Smooth
  2677. Part120.Position = Vector3.new(-18.5721951, 2.14209223, -15.0114365)
  2678. Part120.Orientation = Vector3.new(1.74000001, 87.4599991, 78.7999954)
  2679. Script121.Name = "qPerfectionWeld"
  2680. Script121.Parent = Tool0
  2681. table.insert(cors,sandbox(Script121,function()
  2682. -- Created by Quenty (@Quenty, follow me on twitter).
  2683. -- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
  2684. -- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
  2685.  
  2686. --[[ INSTRUCTIONS
  2687. - Place in the model
  2688. - Make sure model is anchored
  2689. - That's it. It will weld the model and all children.
  2690.  
  2691. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  2692. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  2693. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  2694. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  2695. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  2696. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  2697. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  2698. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  2699.  
  2700. This script is designed to be used is a regular script. In a local script it will weld, but it will not attempt to handle ancestory changes.
  2701. ]]
  2702.  
  2703. --[[ DOCUMENTATION
  2704. - Will work in tools. If ran more than once it will not create more than one weld. This is especially useful for tools that are dropped and then picked up again.
  2705. - Will work in PBS servers
  2706. - Will work as long as it starts out with the part anchored
  2707. - Stores the relative CFrame as a CFrame value
  2708. - Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
  2709. - Utilizes a recursive algorith to find all parts in the model
  2710. - Will reweld on script reparent if the script is initially parented to a tool.
  2711. - Welds as fast as possible
  2712. ]]
  2713.  
  2714. -- qPerfectionWeld.lua
  2715. -- Created 10/6/2014
  2716. -- Author: Quenty
  2717. -- Version 1.0.3
  2718.  
  2719. -- Updated 10/14/2014 - Updated to 1.0.1
  2720. --- Bug fix with existing ROBLOX welds ? Repro by asimo3089
  2721.  
  2722. -- Updated 10/14/2014 - Updated to 1.0.2
  2723. --- Fixed bug fix.
  2724.  
  2725. -- Updated 10/14/2014 - Updated to 1.0.3
  2726. --- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
  2727.  
  2728. local NEVER_BREAK_JOINTS = false -- If you set this to true it will never break joints (this can create some welding issues, but can save stuff like hinges).
  2729.  
  2730.  
  2731. local function CallOnChildren(Instance, FunctionToCall)
  2732. -- Calls a function on each of the children of a certain object, using recursion.
  2733.  
  2734. FunctionToCall(Instance)
  2735.  
  2736. for _, Child in next, Instance:GetChildren() do
  2737. CallOnChildren(Child, FunctionToCall)
  2738. end
  2739. end
  2740.  
  2741. local function GetNearestParent(Instance, ClassName)
  2742. -- Returns the nearest parent of a certain class, or returns nil
  2743.  
  2744. local Ancestor = Instance
  2745. repeat
  2746. Ancestor = Ancestor.Parent
  2747. if Ancestor == nil then
  2748. return nil
  2749. end
  2750. until Ancestor:IsA(ClassName)
  2751.  
  2752. return Ancestor
  2753. end
  2754.  
  2755. local function GetBricks(StartInstance)
  2756. local List = {}
  2757.  
  2758. -- if StartInstance:IsA("BasePart") then
  2759. -- List[#List+1] = StartInstance
  2760. -- end
  2761.  
  2762. CallOnChildren(StartInstance, function(Item)
  2763. if Item:IsA("BasePart") then
  2764. List[#List+1] = Item;
  2765. end
  2766. end)
  2767.  
  2768. return List
  2769. end
  2770.  
  2771. local function Modify(Instance, Values)
  2772. -- Modifies an Instance by using a table.
  2773.  
  2774. assert(type(Values) == "table", "Values is not a table");
  2775.  
  2776. for Index, Value in next, Values do
  2777. if type(Index) == "number" then
  2778. Value.Parent = Instance
  2779. else
  2780. Instance[Index] = Value
  2781. end
  2782. end
  2783. return Instance
  2784. end
  2785.  
  2786. local function Make(ClassType, Properties)
  2787. -- Using a syntax hack to create a nice way to Make new items.
  2788.  
  2789. return Modify(Instance.new(ClassType), Properties)
  2790. end
  2791.  
  2792. local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
  2793. local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
  2794.  
  2795. local function HasWheelJoint(Part)
  2796. for _, SurfaceName in pairs(Surfaces) do
  2797. for _, HingSurfaceName in pairs(HingSurfaces) do
  2798. if Part[SurfaceName].Name == HingSurfaceName then
  2799. return true
  2800. end
  2801. end
  2802. end
  2803.  
  2804. return false
  2805. end
  2806.  
  2807. local function ShouldBreakJoints(Part)
  2808. --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
  2809. -- definitely some edge cases.
  2810.  
  2811. if NEVER_BREAK_JOINTS then
  2812. return false
  2813. end
  2814.  
  2815. if HasWheelJoint(Part) then
  2816. return false
  2817. end
  2818.  
  2819. local Connected = Part:GetConnectedParts()
  2820.  
  2821. if #Connected == 1 then
  2822. return false
  2823. end
  2824.  
  2825. for _, Item in pairs(Connected) do
  2826. if HasWheelJoint(Item) then
  2827. return false
  2828. elseif not Item:IsDescendantOf(script.Parent) then
  2829. return false
  2830. end
  2831. end
  2832.  
  2833. return true
  2834. end
  2835.  
  2836. local function WeldTogether(Part0, Part1, JointType, WeldParent)
  2837. --- Weld's 2 parts together
  2838. -- @param Part0 The first part
  2839. -- @param Part1 The second part (Dependent part most of the time).
  2840. -- @param [JointType] The type of joint. Defaults to weld.
  2841. -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
  2842. -- @return The weld created.
  2843.  
  2844. JointType = JointType or "Weld"
  2845. local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
  2846.  
  2847. local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
  2848. Modify(NewWeld, {
  2849. Name = "qCFrameWeldThingy";
  2850. Part0 = Part0;
  2851. Part1 = Part1;
  2852. C0 = CFrame.new();--Part0.CFrame:inverse();
  2853. C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
  2854. Parent = Part1;
  2855. })
  2856.  
  2857. if not RelativeValue then
  2858. RelativeValue = Make("CFrameValue", {
  2859. Parent = Part1;
  2860. Name = "qRelativeCFrameWeldValue";
  2861. Archivable = true;
  2862. Value = NewWeld.C1;
  2863. })
  2864. end
  2865.  
  2866. return NewWeld
  2867. end
  2868.  
  2869. local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
  2870. -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
  2871. -- @param MainPart The part to weld the model to (can be in the model).
  2872. -- @param [JointType] The type of joint. Defaults to weld.
  2873. -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
  2874.  
  2875. for _, Part in pairs(Parts) do
  2876. if ShouldBreakJoints(Part) then
  2877. Part:BreakJoints()
  2878. end
  2879. end
  2880.  
  2881. for _, Part in pairs(Parts) do
  2882. if Part ~= MainPart then
  2883. WeldTogether(MainPart, Part, JointType, MainPart)
  2884. end
  2885. end
  2886.  
  2887. if not DoNotUnanchor then
  2888. for _, Part in pairs(Parts) do
  2889. Part.Anchored = false
  2890. end
  2891. MainPart.Anchored = false
  2892. end
  2893. end
  2894.  
  2895. local function PerfectionWeld()
  2896. local Tool = GetNearestParent(script, "Tool")
  2897.  
  2898. local Parts = GetBricks(script.Parent)
  2899. local PrimaryPart = Tool and Tool:FindFirstChild("Handle") and Tool.Handle:IsA("BasePart") and Tool.Handle or script.Parent:IsA("Model") and script.Parent.PrimaryPart or Parts[1]
  2900.  
  2901. if PrimaryPart then
  2902. WeldParts(Parts, PrimaryPart, "Weld", false)
  2903. else
  2904. warn("qWeld - Unable to weld part")
  2905. end
  2906.  
  2907. return Tool
  2908. end
  2909.  
  2910. local Tool = PerfectionWeld()
  2911.  
  2912.  
  2913. if Tool and script.ClassName == "Script" then
  2914. --- Don't bother with local scripts
  2915.  
  2916. script.Parent.AncestryChanged:connect(function()
  2917. PerfectionWeld()
  2918. end)
  2919. end
  2920.  
  2921. -- Created by Quenty (@Quenty, follow me on twitter).
  2922.  
  2923. end))
  2924. LocalScript122.Name = "BindKeys"
  2925. LocalScript122.Parent = Tool0
  2926. LocalScript122.Disabled = true
  2927. table.insert(cors,sandbox(LocalScript122,function()
  2928. local plr = game.Players.LocalPlayer
  2929. local chr = plr.Character
  2930. local event = script.Parent.KeyPressed
  2931. local event2 = script.Parent.MiscFuncs
  2932. local equip = script.Parent.Equip
  2933. local m = plr:GetMouse()
  2934. local mus = script.Parent.Handle.Mus
  2935. m.KeyDown:connect(function(k)
  2936. if equip.Value then
  2937. if k == 'e' then
  2938. event:FireServer(k,2)
  2939. elseif k == 'q' then
  2940. event:FireServer(k,10)
  2941. elseif k == 't' then
  2942. event:FireServer(k,5)
  2943. end
  2944. end
  2945. end)
  2946.  
  2947. plr.Chatted:connect(function(msg)
  2948. if equip.Value then
  2949. local mes = string.lower(msg)
  2950. if string.sub(mes,1,2) == 'm;' then
  2951. local input = string.sub(mes,3)
  2952. if input ~= "" then
  2953. event2:FireServer('musid',tonumber(input))
  2954. event2:FireServer('box','Now playing ' .. tostring(game:GetService('MarketplaceService'):GetProductInfo(input).Name))
  2955. else
  2956. event2:FireServer('togglemus')
  2957. end
  2958. elseif string.sub(mes,1,2) == 'v;' then
  2959. local input = string.sub(mes,3)
  2960. if input ~= "" then
  2961. event2:FireServer('vol',tonumber(input))
  2962. else
  2963. event2:FireServer('resetvol')
  2964. end
  2965. elseif string.sub(mes,1,3) == 'pi;' then
  2966. local input = string.sub(mes,4)
  2967. if input ~= "" then
  2968. event2:FireServer('pit',tonumber(input))
  2969. else
  2970. event2:FireServer('resetpit')
  2971. end
  2972. elseif string.sub(mes,1,3) == 'ps;' then
  2973. local input = string.sub(mes,4)
  2974. if input ~= "" then
  2975. event2:FireServer('psh',tonumber(input))
  2976. else
  2977. event2:FireServer('togglepsh')
  2978. end
  2979. elseif string.sub(mes,1,2) == 'd;' then
  2980. local input = string.sub(mes,3)
  2981. if input ~= "" then
  2982. event2:FireServer('dis',tonumber(input))
  2983. else
  2984. event2:FireServer('toggledis')
  2985. end
  2986. end
  2987. end
  2988. end)
  2989.  
  2990. end))
  2991. LocalScript123.Name = "Client"
  2992. LocalScript123.Parent = Tool0
  2993. table.insert(cors,sandbox(LocalScript123,function()
  2994. local Player = game:GetService("Players").LocalPlayer
  2995. local UIS = game:GetService("UserInputService")
  2996. local Mouse = Player:GetMouse()
  2997. local Tool = script.Parent
  2998. local Remote = Tool:WaitForChild("Remote")
  2999. local Tracks = {}
  3000. local InputType = Enum.UserInputType
  3001.  
  3002. local BeganConnection, EndedConnection
  3003.  
  3004. function playAnimation(animName, ...)
  3005. if Tracks[animName] then
  3006. Tracks[animName]:Play()
  3007. else
  3008. local anim = Tool:FindFirstChild(animName)
  3009. if anim and Tool.Parent and Tool.Parent:FindFirstChild("Humanoid") then
  3010. Tracks[animName] = Tool.Parent.Humanoid:LoadAnimation(anim)
  3011. playAnimation(animName, ...)
  3012. end
  3013. end
  3014. end
  3015.  
  3016. function stopAnimation(animName)
  3017. if Tracks[animName] then
  3018. Tracks[animName]:Stop()
  3019. end
  3020. end
  3021.  
  3022. function inputBegan(input)
  3023. if input.UserInputType == InputType.MouseButton1 then
  3024. Remote:FireServer("LeftDown")
  3025. end
  3026. end
  3027.  
  3028. function inputEnded(input)
  3029. if input.UserInputType == InputType.MouseButton1 then
  3030. Remote:FireServer("LeftUp")
  3031. end
  3032. end
  3033.  
  3034. function onRemote(func, ...)
  3035. if func == "PlayAnimation" then
  3036. playAnimation(...)
  3037. elseif func == "StopAnimation" then
  3038. stopAnimation(...)
  3039. end
  3040. end
  3041.  
  3042. function onEquip()
  3043. BeganConnection = UIS.InputBegan:connect(inputBegan)
  3044. EndedConnection = UIS.InputEnded:connect(inputEnded)
  3045. end
  3046.  
  3047. function onUnequip()
  3048. if BeganConnection then
  3049. BeganConnection:disconnect()
  3050. BeganConnection = nil
  3051. end
  3052.  
  3053. if EndedConnection then
  3054. EndedConnection:disconnect()
  3055. EndedConnection = nil
  3056. end
  3057. end
  3058.  
  3059. Tool.Equipped:connect(onEquip)
  3060. Tool.Unequipped:connect(onUnequip)
  3061. Remote.OnClientEvent:connect(onRemote)
  3062. end))
  3063. RemoteEvent124.Name = "KeyPressed"
  3064. RemoteEvent124.Parent = Tool0
  3065. RemoteEvent125.Name = "MiscFuncs"
  3066. RemoteEvent125.Parent = Tool0
  3067. RemoteEvent126.Name = "Remote"
  3068. RemoteEvent126.Parent = Tool0
  3069. Animation127.Name = "R15Swing1"
  3070. Animation127.Parent = Tool0
  3071. Animation127.AnimationId = "rbxassetid://846744780"
  3072. for i,v in pairs(mas:GetChildren()) do
  3073. v.Parent = game:GetService("Players").LocalPlayer.Backpack
  3074. pcall(function() v:MakeJoints() end)
  3075. end
  3076. mas:Destroy()
  3077. for i,v in pairs(cors) do
  3078. spawn(function()
  3079. pcall(v)
  3080. end)
  3081. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement