Advertisement
Animescapetower

Throwable staff

Mar 14th, 2018
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 52.41 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. Part1 = Instance.new("Part")
  21. Sound2 = Instance.new("Sound")
  22. Script3 = Instance.new("Script")
  23. Script4 = Instance.new("Script")
  24. Sound5 = Instance.new("Sound")
  25. Script6 = Instance.new("Script")
  26. Script7 = Instance.new("Script")
  27. Sound8 = Instance.new("Sound")
  28. Script9 = Instance.new("Script")
  29. Script10 = Instance.new("Script")
  30. BoolValue11 = Instance.new("BoolValue")
  31. Sparkles12 = Instance.new("Sparkles")
  32. Script13 = Instance.new("Script")
  33. Script14 = Instance.new("Script")
  34. Script15 = Instance.new("Script")
  35. Animation16 = Instance.new("Animation")
  36. LocalScript17 = Instance.new("LocalScript")
  37. Animation18 = Instance.new("Animation")
  38. LocalScript19 = Instance.new("LocalScript")
  39. Animation20 = Instance.new("Animation")
  40. Sound21 = Instance.new("Sound")
  41. Script22 = Instance.new("Script")
  42. Script23 = Instance.new("Script")
  43. Animation24 = Instance.new("Animation")
  44. Part25 = Instance.new("Part")
  45. BlockMesh26 = Instance.new("BlockMesh")
  46. BoolValue27 = Instance.new("BoolValue")
  47. CornerWedgePart28 = Instance.new("CornerWedgePart")
  48. IntValue29 = Instance.new("IntValue")
  49. Part30 = Instance.new("Part")
  50. SpecialMesh31 = Instance.new("SpecialMesh")
  51. CornerWedgePart32 = Instance.new("CornerWedgePart")
  52. Animation33 = Instance.new("Animation")
  53. Animation34 = Instance.new("Animation")
  54. CornerWedgePart35 = Instance.new("CornerWedgePart")
  55. CornerWedgePart36 = Instance.new("CornerWedgePart")
  56. CornerWedgePart37 = Instance.new("CornerWedgePart")
  57. Animation38 = Instance.new("Animation")
  58. Animation39 = Instance.new("Animation")
  59. Script40 = Instance.new("Script")
  60. Script41 = Instance.new("Script")
  61. Script42 = Instance.new("Script")
  62. Animation43 = Instance.new("Animation")
  63. LocalScript44 = Instance.new("LocalScript")
  64. Part45 = Instance.new("Part")
  65. SpecialMesh46 = Instance.new("SpecialMesh")
  66. ScreenGui47 = Instance.new("ScreenGui")
  67. Frame48 = Instance.new("Frame")
  68. Frame49 = Instance.new("Frame")
  69. Frame50 = Instance.new("Frame")
  70. TextLabel51 = Instance.new("TextLabel")
  71. Part52 = Instance.new("Part")
  72. SpecialMesh53 = Instance.new("SpecialMesh")
  73. BoolValue54 = Instance.new("BoolValue")
  74. StringValue55 = Instance.new("StringValue")
  75. Script56 = Instance.new("Script")
  76. CornerWedgePart57 = Instance.new("CornerWedgePart")
  77. CornerWedgePart58 = Instance.new("CornerWedgePart")
  78. CornerWedgePart59 = Instance.new("CornerWedgePart")
  79. Part60 = Instance.new("Part")
  80. SpecialMesh61 = Instance.new("SpecialMesh")
  81. Part62 = Instance.new("Part")
  82. SpecialMesh63 = Instance.new("SpecialMesh")
  83. Script64 = Instance.new("Script")
  84. Tool0.Name = "ScytheDark"
  85. Tool0.Parent = mas
  86. Tool0.TextureId = "http://www.roblox.com/asset/?id=204661344"
  87. Tool0.GripPos = Vector3.new(0, -2, 0)
  88. Part1.Name = "Handle"
  89. Part1.Parent = Tool0
  90. Part1.BrickColor = BrickColor.new("Dark stone grey")
  91. Part1.Transparency = 1
  92. Part1.Rotation = Vector3.new(-87.909996, 19.9200001, -152.449997)
  93. Part1.Anchored = true
  94. Part1.CanCollide = false
  95. Part1.Locked = true
  96. Part1.FormFactor = Enum.FormFactor.Plate
  97. Part1.Size = Vector3.new(0.25, 1.10000014, 0.25)
  98. Part1.CFrame = CFrame.new(45.8666725, 5.47763586, -14.3797054, -0.833579004, 0.434817016, 0.340705484, 0.28499499, -0.189831018, 0.939543545, 0.473206013, 0.880283117, 0.0343184844)
  99. Part1.BottomSurface = Enum.SurfaceType.Smooth
  100. Part1.TopSurface = Enum.SurfaceType.Smooth
  101. Part1.Color = Color3.new(0.388235, 0.372549, 0.384314)
  102. Part1.Position = Vector3.new(45.8666725, 5.47763586, -14.3797054)
  103. Part1.Orientation = Vector3.new(-69.9799957, 84.25, 123.669998)
  104. Part1.Color = Color3.new(0.388235, 0.372549, 0.384314)
  105. Sound2.Name = "SlashSound"
  106. Sound2.Parent = Part1
  107. Sound2.Pitch = 1.2000000476837
  108. Sound2.SoundId = "http://www.roblox.com/asset/?id=197780401"
  109. Sound2.Volume = 1
  110. Script3.Name = "SoundScript"
  111. Script3.Parent = Sound2
  112. table.insert(cors,sandbox(Script3,function()
  113. function onTouched(hit)
  114. wait(0) --Change the 0 to however long you want the sound to be delayed in seconds.
  115. script.Parent:play() --copy and paste this and the line above it to make the sound repeat.
  116. end
  117. script.Parent.Touched:connect(onTouched)
  118.  
  119.  
  120. end))
  121. Script4.Name = "SoundX"
  122. Script4.Parent = Sound2
  123. table.insert(cors,sandbox(Script4,function()
  124. while true do
  125.  
  126. for i = 100, 120 do
  127. script.Parent.Pitch = i/100
  128. wait()
  129. end
  130. for i = 100, 120 do
  131. script.Parent.Pitch = 2.20-i/100
  132. wait()
  133.  
  134. end
  135. end
  136. end))
  137. Sound5.Name = "SpinSound"
  138. Sound5.Parent = Part1
  139. Sound5.Pitch = 1.2000000476837
  140. Sound5.SoundId = "http://www.roblox.com/asset/?id=156562035"
  141. Sound5.Volume = 1
  142. Script6.Name = "SoundX"
  143. Script6.Parent = Sound5
  144. table.insert(cors,sandbox(Script6,function()
  145. while true do
  146.  
  147. for i = 100, 120 do
  148. script.Parent.Pitch = i/100
  149. wait()
  150. end
  151. for i = 100, 120 do
  152. script.Parent.Pitch = 2.20-i/100
  153. wait()
  154.  
  155. end
  156. end
  157. end))
  158. Script7.Name = "SoundScript"
  159. Script7.Parent = Sound5
  160. table.insert(cors,sandbox(Script7,function()
  161. function onTouched(hit)
  162. wait(0) --Change the 0 to however long you want the sound to be delayed in seconds.
  163. script.Parent:play() --copy and paste this and the line above it to make the sound repeat.
  164. end
  165. script.Parent.Touched:connect(onTouched)
  166.  
  167.  
  168. end))
  169. Sound8.Name = "WhackSound"
  170. Sound8.Parent = Part1
  171. Sound8.Pitch = 0.60000002384186
  172. Sound8.SoundId = "http://www.roblox.com/asset/?id=197780401"
  173. Script9.Name = "SoundX"
  174. Script9.Parent = Sound8
  175. table.insert(cors,sandbox(Script9,function()
  176. while true do
  177.  
  178. for i = 60, 70 do
  179. script.Parent.Pitch = i/100
  180. wait()
  181. end
  182. for i = 60, 70 do
  183. script.Parent.Pitch = 1.3-i/100
  184. wait()
  185.  
  186. end
  187. end
  188. end))
  189. Script10.Name = "SoundScript"
  190. Script10.Parent = Sound8
  191. table.insert(cors,sandbox(Script10,function()
  192. function onTouched(hit)
  193. wait(0) --Change the 0 to however long you want the sound to be delayed in seconds.
  194. script.Parent:play() --copy and paste this and the line above it to make the sound repeat.
  195. end
  196. script.Parent.Touched:connect(onTouched)
  197.  
  198.  
  199. end))
  200. BoolValue11.Name = "Blockable"
  201. BoolValue11.Parent = Part1
  202. BoolValue11.Value = true
  203. Sparkles12.Parent = Part1
  204. Sparkles12.Color = Color3.new(1.77083, 10.2, 0)
  205. Sparkles12.Enabled = false
  206. Sparkles12.SparkleColor = Color3.new(1, 1, 0)
  207. Sparkles12.Color = Color3.new(1.77083, 10.2, 0)
  208. Script13.Name = "SuperKatanaScript"
  209. Script13.Parent = Tool0
  210. table.insert(cors,sandbox(Script13,function()
  211. -- Ninja Katana FTW!!
  212.  
  213. -- handle to the game service object
  214. r = game:service("RunService")
  215.  
  216. -- Normal damage
  217. local nonslash_damage = 333
  218.  
  219. -- special damage when the Ninja slash occurs
  220. local slash_damage = 666
  221.  
  222. local damage = nonslash_damage
  223.  
  224. -- Handle to the tool and its object
  225. sword = script.Parent.Handle
  226. Tool = script.Parent
  227.  
  228. -- Called when the katana(held by a player) comes in contact with
  229. -- another humanoid object
  230. function blow(hit)
  231. local humanoid = hit.Parent:findFirstChild("Humanoid")
  232. local vCharacter = Tool.Parent
  233. local vPlayer = game.Players:playerFromCharacter(vCharacter)
  234. local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
  235. if humanoid~=nil and humanoid ~= hum and hum ~= nil then
  236. -- final check, make sure sword is in-hand
  237.  
  238. local right_arm = vCharacter:FindFirstChild("Right Arm")
  239. if (right_arm ~= nil) then
  240. local joint = right_arm:FindFirstChild("RightGrip")
  241. if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
  242. tagHumanoid(humanoid, vPlayer)
  243. humanoid:TakeDamage(damage)
  244. wait(1)
  245. untagHumanoid(humanoid)
  246. end
  247. end
  248.  
  249.  
  250. end
  251. end
  252.  
  253. function tagHumanoid(humanoid, player)
  254. local creator_tag = Instance.new("ObjectValue")
  255. creator_tag.Value = player
  256. creator_tag.Name = "creator"
  257. creator_tag.Parent = humanoid
  258. end
  259.  
  260. function untagHumanoid(humanoid)
  261. if humanoid ~= nil then
  262. local tag = humanoid:findFirstChild("creator")
  263. if tag ~= nil then
  264. tag.Parent = nil
  265. end
  266. end
  267. end
  268.  
  269.  
  270. function attack()
  271. --SlashSound:play()
  272. if key == "r" then--spin
  273. local SpinMe = script.SpinAttack:Clone()
  274. SpinMe.Parent = script.Parent.Parent.Torso
  275. SpinMe.Disabled = false
  276. local anim = Instance.new("StringValue")
  277. anim.Name = "toolanim"
  278. anim.Value = "Slash"
  279. anim.Parent = Tool
  280. end
  281.  
  282. local debounce = false
  283. function onActivated()
  284. if debounce then return end
  285. debounce = true
  286. damage = slash_damage
  287. print("A")
  288. while Tool.Enabled do wait() end -- necessary to avoid debouncing conflicts between this script and LocalKatanaScript!
  289. attack()
  290. while not Tool.Enabled do wait() end -- necessary to avoid debouncing conflicts between this script and LocalKatanaScript!
  291. damage = nonslash_damage
  292. print("B")
  293. debounce = false
  294. end
  295. end
  296. script.Parent.Activated:connect(onActivated)
  297. script.Parent.Equipped:connect(onEquipped)
  298.  
  299. connection = sword.Touched:connect(blow)
  300.  
  301.  
  302.  
  303.  
  304. end))
  305. Script14.Name = "SpinAttack"
  306. Script14.Parent = Script13
  307. Script14.Disabled = true
  308. table.insert(cors,sandbox(Script14,function()
  309. local torso = script.Parent
  310. script.ForceClean.Disabled = false
  311. if torso ~= nil then
  312.  
  313. local spinForce = Instance.new("BodyAngularVelocity")
  314. spinForce.Name = "DDD"
  315. spinForce.P = 5000000
  316. spinForce.angularvelocity = Vector3.new(0,20,0)
  317. spinForce.maxTorque = Vector3.new(spinForce.P,spinForce.P,spinForce.P)
  318. spinForce.Parent = torso
  319. debris:AddItem(spinForce, 1)
  320. wait(1)
  321. end
  322. end))
  323. Script15.Name = "ForceClean"
  324. Script15.Parent = Script14
  325. Script15.Disabled = true
  326. table.insert(cors,sandbox(Script15,function()
  327. wait(.75)
  328. script.Parent.Parent.DDD:remove()
  329. script.Parent:remove()
  330. end))
  331. Animation16.Name = "Ninja Dash"
  332. Animation16.Parent = Tool0
  333. Animation16.AnimationId = "http://www.roblox.com/Asset?ID=45828430"
  334. LocalScript17.Name = "LocalKatanaScript"
  335. LocalScript17.Parent = Tool0
  336. table.insert(cors,sandbox(LocalScript17,function()
  337. local Tool = script.Parent
  338. Tool.Enabled = true
  339.  
  340. local r = game:GetService("RunService")
  341.  
  342. --invisible forces to move player around
  343. --body velocity
  344. local newBV = nil
  345. --body gyro
  346. local newBG = nil
  347. --body angualar velocity
  348. local newBAV = nil
  349. --body position
  350. local newBP = nil
  351.  
  352. local slashSound = Tool.Handle.SlashSound
  353. local spinSound = Tool.Handle.SpinSound
  354. local whackSound = Tool.Handle.WhackSound
  355.  
  356. --hum = local player's humanoid model
  357. --torso = local player's torso
  358. function slashIt(hum, torso)
  359. nsAnim = hum:LoadAnimation(Tool["Ninja Slash"])
  360. if nsAnim == nil then Tool.Enabled = true return end
  361.  
  362. nsAnim:Play()
  363. --where the player's torso is pointing
  364. if game.Players.NumPlayers>1 then
  365. target = getNearestPlayer().Character.Torso.CFrame.p
  366. else target = hum.TargetPoint end
  367.  
  368. local dir = (target - torso.Position) * Vector3.new(1, 0, 1)
  369. newBV = nil
  370. if dir.magnitude > .01 then
  371. -- make 'em dash forwards too
  372. dir = dir.unit
  373. newBV = Instance.new("BodyVelocity")
  374. newBV.P = 100000
  375. newBV.maxForce = Vector3.new(newBV.P, 0, newBV.P)
  376. newBV.velocity = dir * 50
  377. newBV.Parent = torso
  378.  
  379. torso.CFrame = CFrame.new(torso.Position, target * Vector3.new(1, 0, 1) + Vector3.new(0, torso.Position.Y, 0))
  380. end
  381.  
  382. wait(.5)
  383. slashSound:Play()
  384. if newBV ~= nil then newBV:remove() end
  385. wait(.5)
  386. end
  387.  
  388. function blowIt(iterations)
  389.  
  390. nsAnim = hum:LoadAnimation(Tool["dualslash2"])
  391. nsAnim:Play()
  392. wait(.75)
  393. --create line explosion
  394. local exp_loc=Tool.Handle.CFrame.p
  395. --local exp_dir= Vector3.new(Tool.Parent.Torso.CFrame.lookVector)
  396. local exp_dir= torso.CFrame.lookVector
  397. Tool.lineExplosion:Play()
  398. for i=2, iterations, 1 do
  399. local explosion = Instance.new('Explosion', Workspace)
  400. explosion.ExplosionType = Enum.ExplosionType.CratersAndDebris
  401. explosion.Position=exp_loc+(exp_dir*(i*10))--test
  402. explosion.BlastPressure = 1
  403. explosion.BlastRadius = 5
  404. wait(.05)
  405. end
  406.  
  407. end
  408.  
  409. --returns closest player object
  410. function getNearestPlayer()
  411. local nearest=nil
  412. local nearest_distance=0
  413. local tdist = 0
  414. local parent_pos= game.Players.LocalPlayer.Character.Torso.CFrame.p
  415. local player= nil
  416. for _, player in pairs(game.Players:GetPlayers()) do
  417. print (player)
  418. if player.Character and player~=game.Players.LocalPlayer then
  419. tdist= (player.Character.Torso.CFrame.p-parent_pos).magnitude
  420. if nearest==nil or tdist<nearest_distance then
  421. nearest_distance=tdist
  422. nearest=player
  423. end
  424. end
  425. end
  426. return nearest
  427. end
  428.  
  429. --hum = local player's humanoid model
  430. --torso = local player's torso
  431. function dashIt(hum, torso)
  432.  
  433. ndAnim = hum:LoadAnimation(Tool["Ninja Dash"])
  434. if ndAnim == nil then Tool.Enabled = true return end
  435.  
  436. if game.Players.NumPlayers>1 then
  437. target = getNearestPlayer().Character.Torso.CFrame.p
  438. else target = hum.TargetPoint end
  439.  
  440. print (target)
  441. local dir = (target - torso.Position) * Vector3.new(1, 0, 1)
  442. if dir.magnitude < .01 then Tool.Enabled = true return end
  443. dir = dir.unit
  444.  
  445. newBG = Instance.new("BodyGyro")
  446. newBG.P = 30000
  447. newBG.maxTorque = Vector3.new(newBG.P, newBG.P, newBG.P)
  448. --newBG.cframe = torso.CFrame * CFrame.Angles(-math.pi/2, 0, 0)
  449. local torsoPosition = torso.Position
  450. newBG.cframe = CFrame.new(torsoPosition, target*Vector3.new(1,0,1) + Vector3.new(0, torsoPosition.Y, 0) ) * CFrame.Angles(-math.pi/2, 0, 0)
  451. newBG.Parent = torso
  452.  
  453. newBP = Instance.new("BodyPosition")
  454. newBP.P = 100000
  455. newBP.maxForce = Vector3.new(newBP.P, newBP.P, newBP.P)
  456. newBP.position = torsoPosition + Vector3.new(0, 1.5, 0)
  457. newBP.Parent = torso
  458.  
  459. newBAV = Instance.new("BodyAngularVelocity")
  460. newBAV.P = 100000
  461. newBAV.maxTorque = Vector3.new(newBAV.P, newBAV.P, newBAV.P)
  462.  
  463. newBV = Instance.new("BodyVelocity")
  464. newBV.P = 100000
  465. newBV.maxForce = Vector3.new(newBV.P, 0, newBV.P)
  466. newBV.velocity = dir * 64
  467.  
  468. ndAnim:Play()
  469. wait(.5)
  470. spinSound:Play()
  471. newBG.maxTorque = Vector3.new(newBP.P, 0, newBP.P)
  472. newBP.maxForce = Vector3.new(0, newBP.P, 0)
  473. newBV.Parent = torso
  474.  
  475. newBAV.angularvelocity = torso.CFrame:vectorToWorldSpace(Vector3.new(0, -30, 0))
  476. hum.Sit = true
  477. newBAV.Parent = torso
  478.  
  479. wait(1)
  480.  
  481. -- testing for fun
  482. -- for i = 1, 50 do
  483. --target = hum.TargetPoint
  484. --newdir = (target - torso.Position) * Vector3.new(1, 0, 1)
  485. --if newdir.magnitude > .01 then
  486. -- dir = newdir
  487. --dir = dir.unit
  488. --newBV.velocity = dir * 32
  489. --end
  490.  
  491. --newBG.cframe = CFrame.new(torso.Position, target*Vector3.new(1,0,1) + Vector3.new(0, torso.Position.Y, 0) ) * CFrame.Angles(-math.pi/2, 0, 0)
  492.  
  493. --wait(.1)
  494. --end
  495. -- end of testing for fun
  496.  
  497.  
  498. --for i = 1, 3 do
  499. -- ndAnim:Play()
  500. --wait(2)
  501. --end
  502.  
  503. hum.Sit = false
  504. if newBAV ~= nil then newBAV:remove() end
  505. if newBP ~= nil then newBP:remove() end
  506. if newBV ~= nil then newBV:remove() end
  507.  
  508. if newBG ~= nil then newBG.cframe = CFrame.new(torsoPosition, target*Vector3.new(1,0,1) + Vector3.new(0, torsoPosition.Y, 0) ) end
  509. if newBG ~= nil then newBG.maxTorque = Vector3.new(newBG.P, newBG.P, newBG.P) end
  510. spinSound:Stop()
  511. wait(.25)
  512. if newBG ~= nil then newBG:remove() end
  513. end
  514.  
  515. local ultra_step_num=-1
  516. --time last key was pressed
  517. local lastWDown = 0
  518. local lastADown = 0
  519. local lastDDown = 0
  520. --time that dash was activated(see onKeyDown)
  521. local dashTime = 0
  522. --time of last slatsh effect
  523. local lastSlash = 0
  524. local lastSuperStrike = 0
  525. local amAnimating = false
  526. function onActivated()
  527. --cant find vChar's declaration??
  528. --vChar=player?
  529. vChar = Tool.Parent
  530. if vChar == nil then return end
  531. --hum = humanoid(player model)
  532. hum = vChar:FindFirstChild("Humanoid")
  533. if hum == nil then return end
  534. --if not Tool.Enabled then return end
  535. if amAnimating then return end
  536. Tool.Enabled = false
  537. amAnimating = true
  538.  
  539. torso = vChar:FindFirstChild("Torso")
  540. if torso == nil then Tool.Enabled = true return end
  541.  
  542. t = r.Stepped:wait()
  543. if t - lastSuperStrike < .2 then
  544. blowIt(10)
  545. wait(.5) -- reload time
  546. amAnimating = false
  547. elseif t - dashTime < .2 then --special double click
  548. -- dash attack
  549. dashIt(hum, torso)
  550. wait(.5) -- reload time
  551. amAnimating = false
  552. elseif t - lastSlash < .2 then --normal double click
  553. -- slash attack
  554. slashIt(hum, torso)
  555. --wait(1)
  556. amAnimating = false
  557. --wait(.5) -- reload time
  558. else
  559. -- normal attack
  560. whackSound:Play()
  561. lastSlash = t
  562. amAnimating = false -- here must be before the wait, to allow for double-clix
  563. wait(.5)
  564. end
  565. if not amAnimating then Tool.Enabled = true end
  566. end
  567.  
  568. local keyConnection = nil
  569. local keytime = 0
  570. function onKeyDown(key)
  571. keytime = r.Stepped:wait()
  572. if key:lower() == "q" then
  573. if (keytime - lastWDown < 1) then dashTime = keytime end
  574. lastWDown = keytime
  575. elseif key:lower() == "r" then
  576. lastADown = keytime
  577. --[[elseif key:lower() == "r" then
  578. lastDDown = keytime
  579. if lastDDown-lastADown < 1 and lastWDown>lastADown then
  580. print("SUPER STRIKE")
  581. lastSuperStrike=keytime]]
  582. elseif key:lower() == "e" then
  583. lastSuperStrike=keytime
  584. end
  585. end
  586. --end
  587.  
  588. function onEquippedLocal(mouse)
  589. slashSound.Volume = 1
  590. spinSound.Volume = 1
  591. whackSound.Volume = 1
  592.  
  593. keyConnection = mouse.KeyDown:connect(onKeyDown)
  594.  
  595. vChar = Tool.Parent
  596. if vChar == nil then return end
  597. --hum = humanoid(player model)
  598. hum = vChar:FindFirstChild("Humanoid")
  599. nsAnim = hum:LoadAnimation(Tool.swordPumpUp)
  600. nsAnim:Play()
  601. nsAnim:AdjustSpeed(3)
  602. end
  603.  
  604. function onUnequippedLocal()
  605. if keyConnection ~= nil then keyConnection:disconnect() end
  606.  
  607. if newBV ~= nil then newBV:remove() end
  608. if newBG ~= nil then newBG:remove() end
  609. if newBAV ~= nil then newBAV:remove() end
  610. if newBP ~= nil then newBP:remove() end
  611.  
  612. slashSound.Volume = 0
  613. spinSound.Volume = 0
  614. whackSound.Volume = 0
  615. end
  616.  
  617. Tool.Equipped:connect(onEquippedLocal)
  618. Tool.Unequipped:connect(onUnequippedLocal)
  619. Tool.Activated:connect(onActivated)
  620.  
  621. end))
  622. Animation18.Name = "Ninja Slash"
  623. Animation18.Parent = Tool0
  624. Animation18.AnimationId = "http://www.roblox.com/Asset?ID=45873069"
  625. LocalScript19.Name = "Local Gui"
  626. LocalScript19.Parent = Tool0
  627. table.insert(cors,sandbox(LocalScript19,function()
  628. local Tool = script.Parent;
  629.  
  630. local stillEquipped = true
  631. function onEquippedLocal(mouse)
  632. stillEquipped = true
  633. if mouse == nil then
  634. print("Mouse not found")
  635. return
  636. end
  637.  
  638. while stillEquipped do
  639. print("Setting Mouse to Go")
  640. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  641.  
  642. while Tool.Enabled and stillEquipped do
  643. wait(.01)
  644. end
  645.  
  646. print("Setting Mouse To Wait")
  647. mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
  648.  
  649. while not Tool.Enabled and stillEquipped do
  650. wait(.01)
  651. end
  652. end
  653. end
  654.  
  655. function onUnequippedLocal()
  656. stillEquipped = false
  657. end
  658.  
  659.  
  660. Tool.Equipped:connect(onEquippedLocal)
  661. Tool.Unequipped:connect(onUnequippedLocal)
  662.  
  663. end))
  664. Animation20.Name = "dualslash2"
  665. Animation20.Parent = Tool0
  666. Animation20.AnimationId = "http://www.roblox.com/Asset?ID=85576403"
  667. Sound21.Name = "lineExplosion"
  668. Sound21.Parent = Tool0
  669. Sound21.Pitch = 0.60000002384186
  670. Sound21.SoundId = "http://www.roblox.com/Asset?ID=185722889"
  671. Script22.Name = "SoundScript"
  672. Script22.Parent = Sound21
  673. table.insert(cors,sandbox(Script22,function()
  674. function onTouched(hit)
  675. wait(0) --Change the 0 to however long you want the sound to be delayed in seconds.
  676. script.Parent:play() --copy and paste this and the line above it to make the sound repeat.
  677. end
  678. script.Parent.Touched:connect(onTouched)
  679.  
  680.  
  681. end))
  682. Script23.Name = "SoundX"
  683. Script23.Parent = Sound21
  684. table.insert(cors,sandbox(Script23,function()
  685. while true do
  686.  
  687. for i = 60, 80 do
  688. script.Parent.Pitch = i/100
  689. wait()
  690. end
  691. for i = 60, 80 do
  692. script.Parent.Pitch = 1.4-i/100
  693. wait()
  694.  
  695. end
  696. end
  697. end))
  698. Animation24.Name = "swordPumpUp"
  699. Animation24.Parent = Tool0
  700. Animation24.AnimationId = "http://www.roblox.com/Asset?ID=85723345"
  701. Part25.Name = "HX"
  702. Part25.Parent = Tool0
  703. Part25.Material = Enum.Material.Fabric
  704. Part25.BrickColor = BrickColor.new("Really black")
  705. Part25.Rotation = Vector3.new(96.4599991, -14.3400002, 90.2799988)
  706. Part25.FormFactor = Enum.FormFactor.Custom
  707. Part25.Size = Vector3.new(0.0500000045, 0.155000001, 0.155000001)
  708. Part25.CFrame = CFrame.new(45.6886292, 5.63382578, -14.5855122, -0.00465982407, -0.968833387, -0.247669607, -0.111327291, 0.246635318, -0.962692618, 0.993772805, 0.0230864156, -0.109006912)
  709. Part25.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  710. Part25.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  711. Part25.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  712. Part25.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  713. Part25.RightSurface = Enum.SurfaceType.SmoothNoOutlines
  714. Part25.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  715. Part25.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  716. Part25.Position = Vector3.new(45.6886292, 5.63382578, -14.5855122)
  717. Part25.Orientation = Vector3.new(74.2999954, -113.759995, -24.289999)
  718. Part25.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  719. BlockMesh26.Parent = Part25
  720. BlockMesh26.Scale = Vector3.new(0.25, 1, 1)
  721. BlockMesh26.Scale = Vector3.new(0.25, 1, 1)
  722. BoolValue27.Name = "MouseDown"
  723. BoolValue27.Parent = Tool0
  724. CornerWedgePart28.Parent = Tool0
  725. CornerWedgePart28.Material = Enum.Material.Ice
  726. CornerWedgePart28.BrickColor = BrickColor.new("Medium blue")
  727. CornerWedgePart28.Rotation = Vector3.new(163.399994, -5.46000004, -136.720001)
  728. CornerWedgePart28.Size = Vector3.new(0.140881032, 0.352202654, 0.140881032)
  729. CornerWedgePart28.CFrame = CFrame.new(46.0641403, 6.07490969, -13.147522, -0.72467196, 0.682498157, -0.0951149613, 0.676821768, 0.679019213, -0.284332901, -0.129471824, -0.270423949, -0.953995645)
  730. CornerWedgePart28.Color = Color3.new(0.431373, 0.6, 0.792157)
  731. CornerWedgePart28.Position = Vector3.new(46.0641403, 6.07490969, -13.147522)
  732. CornerWedgePart28.Orientation = Vector3.new(16.5200005, -174.309998, 44.9099998)
  733. CornerWedgePart28.Color = Color3.new(0.431373, 0.6, 0.792157)
  734. IntValue29.Name = "WeaponSpeed"
  735. IntValue29.Parent = Tool0
  736. IntValue29.Value = 98
  737. Part30.Name = "FakeHandle"
  738. Part30.Parent = Tool0
  739. Part30.Material = Enum.Material.Fabric
  740. Part30.BrickColor = BrickColor.new("Dark stone grey")
  741. Part30.Rotation = Vector3.new(72.1199951, -13.2199993, 84.3899994)
  742. Part30.FormFactor = Enum.FormFactor.Custom
  743. Part30.Size = Vector3.new(0.5200001, 0.10050001, 0.10050001)
  744. Part30.CFrame = CFrame.new(45.6853752, 5.56908894, -14.7886391, 0.0951149762, -0.968833447, -0.228724718, 0.284332931, 0.246635154, -0.926458716, 0.953995764, 0.0230861325, 0.29892993)
  745. Part30.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  746. Part30.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  747. Part30.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  748. Part30.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  749. Part30.RightSurface = Enum.SurfaceType.SmoothNoOutlines
  750. Part30.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  751. Part30.Color = Color3.new(0.388235, 0.372549, 0.384314)
  752. Part30.Position = Vector3.new(45.6853752, 5.56908894, -14.7886391)
  753. Part30.Orientation = Vector3.new(67.8899994, -37.4199982, 49.0599976)
  754. Part30.Color = Color3.new(0.388235, 0.372549, 0.384314)
  755. SpecialMesh31.Parent = Part30
  756. SpecialMesh31.MeshType = Enum.MeshType.Cylinder
  757. CornerWedgePart32.Parent = Tool0
  758. CornerWedgePart32.Material = Enum.Material.Ice
  759. CornerWedgePart32.BrickColor = BrickColor.new("Medium blue")
  760. CornerWedgePart32.Rotation = Vector3.new(-100.829994, -46.4399986, -82.0699997)
  761. CornerWedgePart32.Size = Vector3.new(0.140881032, 0.352202654, 0.140881032)
  762. CornerWedgePart32.CFrame = CFrame.new(45.9620438, 6.17026043, -13.1657629, 0.0951149613, 0.682498157, -0.72467196, 0.284332901, 0.679019213, 0.676821768, 0.953995645, -0.270423949, -0.129471824)
  763. CornerWedgePart32.Color = Color3.new(0.431373, 0.6, 0.792157)
  764. CornerWedgePart32.Position = Vector3.new(45.9620438, 6.17026043, -13.1657629)
  765. CornerWedgePart32.Orientation = Vector3.new(-42.5999985, -100.129997, 22.7199993)
  766. CornerWedgePart32.Color = Color3.new(0.431373, 0.6, 0.792157)
  767. Animation33.Name = "Stab1"
  768. Animation33.Parent = Tool0
  769. Animation33.AnimationId = "http://www.roblox.com/Asset?ID=48146273"
  770. Animation34.Name = "Equip"
  771. Animation34.Parent = Tool0
  772. Animation34.AnimationId = "http://www.roblox.com/Asset?ID=94160581"
  773. CornerWedgePart35.Parent = Tool0
  774. CornerWedgePart35.Material = Enum.Material.Ice
  775. CornerWedgePart35.BrickColor = BrickColor.new("Medium blue")
  776. CornerWedgePart35.Rotation = Vector3.new(163.399994, -5.46000004, 43.2799988)
  777. CornerWedgePart35.Size = Vector3.new(0.140881032, 0.352202654, 0.140881032)
  778. CornerWedgePart35.CFrame = CFrame.new(45.7216682, 5.93110895, -13.0705194, 0.72467196, -0.682498157, -0.0951149613, -0.676821768, -0.679019213, -0.284332901, 0.129471824, 0.270423949, -0.953995645)
  779. CornerWedgePart35.Color = Color3.new(0.431373, 0.6, 0.792157)
  780. CornerWedgePart35.Position = Vector3.new(45.7216682, 5.93110895, -13.0705194)
  781. CornerWedgePart35.Orientation = Vector3.new(16.5200005, -174.309998, -135.089996)
  782. CornerWedgePart35.Color = Color3.new(0.431373, 0.6, 0.792157)
  783. CornerWedgePart36.Parent = Tool0
  784. CornerWedgePart36.Material = Enum.Material.Ice
  785. CornerWedgePart36.BrickColor = BrickColor.new("Medium blue")
  786. CornerWedgePart36.Rotation = Vector3.new(79.1699982, 46.4399986, -97.9300003)
  787. CornerWedgePart36.Size = Vector3.new(0.140881032, 0.352202654, 0.140881032)
  788. CornerWedgePart36.CFrame = CFrame.new(46.0775337, 6.11496639, -13.0131226, -0.0951149613, 0.682498157, 0.72467196, -0.284332901, 0.679019213, -0.676821768, -0.953995645, -0.270423949, 0.129471824)
  789. CornerWedgePart36.Color = Color3.new(0.431373, 0.6, 0.792157)
  790. CornerWedgePart36.Position = Vector3.new(46.0775337, 6.11496639, -13.0131226)
  791. CornerWedgePart36.Orientation = Vector3.new(42.5999985, 79.8699951, -22.7199993)
  792. CornerWedgePart36.Color = Color3.new(0.431373, 0.6, 0.792157)
  793. CornerWedgePart37.Parent = Tool0
  794. CornerWedgePart37.Material = Enum.Material.Ice
  795. CornerWedgePart37.BrickColor = BrickColor.new("Medium blue")
  796. CornerWedgePart37.Rotation = Vector3.new(-16.6000004, 5.46000004, -43.2799988)
  797. CornerWedgePart37.Size = Vector3.new(0.140881032, 0.352202654, 0.140881032)
  798. CornerWedgePart37.CFrame = CFrame.new(45.9754448, 6.21031809, -13.0313625, 0.72467196, 0.682498157, 0.0951149613, -0.676821768, 0.679019213, 0.284332901, 0.129471824, -0.270423949, 0.953995645)
  799. CornerWedgePart37.Color = Color3.new(0.431373, 0.6, 0.792157)
  800. CornerWedgePart37.Position = Vector3.new(45.9754448, 6.21031809, -13.0313625)
  801. CornerWedgePart37.Orientation = Vector3.new(-16.5200005, 5.69000006, -44.9099998)
  802. CornerWedgePart37.Color = Color3.new(0.431373, 0.6, 0.792157)
  803. Animation38.Name = "Stab2"
  804. Animation38.Parent = Tool0
  805. Animation38.AnimationId = "http://www.roblox.com/Asset?ID=48146273"
  806. Animation39.Name = "Hold"
  807. Animation39.Parent = Tool0
  808. Animation39.AnimationId = "http://www.roblox.com/Asset?ID=48146273"
  809. Script40.Name = "WeaponScript"
  810. Script40.Parent = Tool0
  811. table.insert(cors,sandbox(Script40,function()
  812. local tool = script.Parent
  813. tool.Equipped:connect(function(mouse)
  814. mouse.KeyDown:connect(function(key)
  815. if key == "r" then--spin
  816. local SpinMe = script.SpinAttack:Clone()
  817. SpinMe.Parent = script.Parent.Parent.Torso
  818. SpinMe.Disabled = false
  819.  
  820. local SpinMe2 = Instance.new("Sound")
  821. SpinMe2.Parent = script.Parent.Handle
  822. SpinMe2.Pitch = .8
  823. SpinMe2.Volume = 1
  824. SpinMe2.SoundId = "http://www.roblox.com/asset/?id=158508669"
  825. SpinMe2.PlayOnRemove = true
  826. SpinMe2:remove()
  827. wait(2)
  828. end
  829. end)
  830. end)
  831. end))
  832. Script41.Name = "SpinAttack"
  833. Script41.Parent = Script40
  834. Script41.Disabled = true
  835. table.insert(cors,sandbox(Script41,function()
  836. torso = script.Parent
  837. script.ForceClean.Disabled=false
  838.  
  839. local spinForce = Instance.new("BodyAngularVelocity")
  840. spinForce.Name = "DDD"
  841. spinForce.P = 5000000
  842. spinForce.angularvelocity = Vector3.new(0,20,0)
  843. spinForce.maxTorque = Vector3.new(spinForce.P,spinForce.P,spinForce.P)
  844. spinForce.Parent = torso
  845. debris:AddItem(spinForce, 1)
  846. wait(1)
  847. end))
  848. Script42.Name = "ForceClean"
  849. Script42.Parent = Script41
  850. Script42.Disabled = true
  851. table.insert(cors,sandbox(Script42,function()
  852. wait(.75)
  853. script.Parent.Parent.DDD:remove()
  854. script.Parent:remove()
  855. end))
  856. Animation43.Name = "LeftSlash"
  857. Animation43.Parent = Tool0
  858. Animation43.AnimationId = "http://www.roblox.com/Asset?ID=74894663"
  859. LocalScript44.Parent = Tool0
  860. table.insert(cors,sandbox(LocalScript44,function()
  861. sp=script.Parent
  862.  
  863.  
  864. function waitfor(a,b)
  865. while a:FindFirstChild(b)==nil do
  866. a.ChildAdded:wait()
  867. end
  868. return a:FindFirstChild(b)
  869. end
  870.  
  871. reloading=waitfor(sp,"Reloading")
  872. down=waitfor(sp,"MouseDown")
  873. runanim=waitfor(sp,"RunAnim")
  874.  
  875. animspeed=1.2 --lower number is slower
  876. equipspeed=1.5
  877. originalgrip=CFrame.new(0,0,-1.1,0,0,1,1,0,0,0,1,0)
  878. currentgrip=originalgrip
  879. function swordUp()
  880. currentgrip=originalgrip
  881. sp.Grip=currentgrip
  882. end
  883. function swordOut()
  884. currentgrip=originalgrip*CFrame.Angles(math.pi/4,.4,0)
  885. sp.Grip=currentgrip
  886. end
  887. function spinsword(spintime)
  888. delay(0,function()
  889. local startspin=tick()
  890. local endspin=startspin+spintime
  891. while tick()<endspin do
  892. sp.Grip=currentgrip*CFrame.Angles(math.pi*2*((tick()-startspin)/spintime),0,0)
  893. wait()
  894. end
  895. sp.Grip=currentgrip
  896. end)
  897. end
  898.  
  899. function update(mouse)
  900. if mouse~=nil then
  901. if reloading.Value then
  902. mouse.Icon="rbxasset://textures\\GunWaitCursor.png"
  903. else
  904. mouse.Icon="rbxasset://textures\\GunCursor.png"
  905. end
  906. end
  907. end
  908.  
  909. runanim.Changed:connect(function()
  910. local h=sp.Parent:FindFirstChild("Humanoid")
  911. local t=sp.Parent:FindFirstChild("Torso")
  912. local anim=sp:FindFirstChild(runanim.Value)
  913. if anim and t and h then
  914. local theanim=h:LoadAnimation(anim)
  915. if theanim and h.Health>0 then
  916. theanim:Play(nil,nil,animspeed)
  917. end
  918. end
  919. end)
  920.  
  921.  
  922. function Equipped(mouse)
  923. if mouse~=nil then
  924. update(mouse)
  925. reloading.Changed:connect(function()
  926. update(mouse)
  927. end)
  928. mouse.Button1Down:connect(function()
  929. down.Value=true
  930. end)
  931. mouse.Button1Up:connect(function()
  932. down.Value=false
  933. end)
  934. local h=sp.Parent:FindFirstChild("Humanoid")
  935. local t=sp.Parent:FindFirstChild("Torso")
  936. if t and h then
  937. local equipanim=sp:FindFirstChild("Equip")
  938. if equipanim~=nil then
  939. local EquipAnim=h:LoadAnimation(equipanim)
  940. if EquipAnim and h.Health>0 then
  941. EquipAnim:Play(nil,nil,equipspeed)
  942. end
  943. end
  944. local holdanim=sp:FindFirstChild("Hold")
  945. if holdanim~=nil then
  946. if HoldAnim then
  947. HoldAnim:Stop()
  948. end
  949. HoldAnim=h:LoadAnimation(holdanim)
  950. if HoldAnim and h.Health>0 then
  951. HoldAnim:Play()
  952. end
  953. end
  954. end
  955. end
  956. end
  957.  
  958. function Unequipped()
  959. down.Value=false
  960. if HoldAnim then
  961. HoldAnim:Stop()
  962. end
  963. end
  964.  
  965. sp.Equipped:connect(Equipped)
  966. sp.Unequipped:connect(Unequipped)
  967.  
  968. end))
  969. Part45.Parent = Tool0
  970. Part45.Material = Enum.Material.Metal
  971. Part45.BrickColor = BrickColor.new("Black")
  972. Part45.Rotation = Vector3.new(72.1199951, -13.2199993, 84.3899994)
  973. Part45.FormFactor = Enum.FormFactor.Custom
  974. Part45.Size = Vector3.new(0.62500006, 0.125, 0.125)
  975. Part45.CFrame = CFrame.new(45.792614, 5.88966942, -13.7130146, 0.0951149762, -0.968833447, -0.228724718, 0.284332931, 0.246635154, -0.926458716, 0.953995764, 0.0230861325, 0.29892993)
  976. Part45.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  977. Part45.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  978. Part45.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  979. Part45.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  980. Part45.RightSurface = Enum.SurfaceType.SmoothNoOutlines
  981. Part45.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  982. Part45.Color = Color3.new(0.105882, 0.164706, 0.207843)
  983. Part45.Position = Vector3.new(45.792614, 5.88966942, -13.7130146)
  984. Part45.Orientation = Vector3.new(67.8899994, -37.4199982, 49.0599976)
  985. Part45.Color = Color3.new(0.105882, 0.164706, 0.207843)
  986. SpecialMesh46.Parent = Part45
  987. SpecialMesh46.MeshType = Enum.MeshType.Cylinder
  988. ScreenGui47.Name = "WeaponHud"
  989. ScreenGui47.Parent = Tool0
  990. Frame48.Name = "Bar"
  991. Frame48.Parent = ScreenGui47
  992. Frame48.Size = UDim2.new(0, 200, 0, 40)
  993. Frame48.Style = Enum.FrameStyle.RobloxRound
  994. Frame48.Position = UDim2.new(0.5, -100, 1, -160)
  995. Frame48.Visible = false
  996. Frame48.ZIndex = 4
  997. Frame49.Name = "Fill"
  998. Frame49.Parent = Frame48
  999. Frame49.Size = UDim2.new(1, 0, 1, 0)
  1000. Frame49.BackgroundColor3 = Color3.new(0, 1, 0)
  1001. Frame49.BorderSizePixel = 0
  1002. Frame49.ZIndex = 5
  1003. Frame50.Name = "Backing"
  1004. Frame50.Parent = Frame48
  1005. Frame50.Size = UDim2.new(1, 0, 1, 0)
  1006. Frame50.BackgroundColor3 = Color3.new(0, 0, 0)
  1007. Frame50.BorderSizePixel = 0
  1008. Frame50.ZIndex = 4
  1009. TextLabel51.Name = "WeaponName"
  1010. TextLabel51.Parent = ScreenGui47
  1011. TextLabel51.Transparency = 1
  1012. TextLabel51.Size = UDim2.new(0, 400, 0, 20)
  1013. TextLabel51.Text = "Dagger"
  1014. TextLabel51.Position = UDim2.new(0.5, -200, 1, -185)
  1015. TextLabel51.Visible = false
  1016. TextLabel51.BackgroundTransparency = 1
  1017. TextLabel51.BorderSizePixel = 0
  1018. TextLabel51.ZIndex = 4
  1019. TextLabel51.ClipsDescendants = true
  1020. TextLabel51.Font = Enum.Font.ArialBold
  1021. TextLabel51.FontSize = Enum.FontSize.Size18
  1022. TextLabel51.TextColor3 = Color3.new(0, 0, 0)
  1023. TextLabel51.TextStrokeColor3 = Color3.new(0.698039, 0.698039, 0.698039)
  1024. TextLabel51.TextTransparency = 0.20000000298023
  1025. Part52.Parent = Tool0
  1026. Part52.Material = Enum.Material.Metal
  1027. Part52.BrickColor = BrickColor.new("Black")
  1028. Part52.Rotation = Vector3.new(72.1199951, -13.2199993, 84.3899994)
  1029. Part52.FormFactor = Enum.FormFactor.Custom
  1030. Part52.Size = Vector3.new(0.0825000033, 0.0825000033, 0.0825000033)
  1031. Part52.CFrame = CFrame.new(45.6033363, 5.3238492, -15.6114674, 0.0951151401, -0.968833447, -0.228724658, 0.284334123, 0.246635124, -0.926458538, 0.953995466, 0.0230860114, 0.298931152)
  1032. Part52.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  1033. Part52.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  1034. Part52.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  1035. Part52.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  1036. Part52.RightSurface = Enum.SurfaceType.SmoothNoOutlines
  1037. Part52.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  1038. Part52.Color = Color3.new(0.105882, 0.164706, 0.207843)
  1039. Part52.Position = Vector3.new(45.6033363, 5.3238492, -15.6114674)
  1040. Part52.Orientation = Vector3.new(67.8899994, -37.4199982, 49.0599976)
  1041. Part52.Color = Color3.new(0.105882, 0.164706, 0.207843)
  1042. SpecialMesh53.Parent = Part52
  1043. SpecialMesh53.MeshType = Enum.MeshType.Sphere
  1044. BoolValue54.Name = "Reloading"
  1045. BoolValue54.Parent = Tool0
  1046. StringValue55.Name = "RunAnim"
  1047. StringValue55.Parent = Tool0
  1048. Script56.Parent = Tool0
  1049. table.insert(cors,sandbox(Script56,function()
  1050. sp=script.Parent
  1051.  
  1052.  
  1053. damage=500 --Change damage value if 'ya want.
  1054. damagewindow=1 --after clicking, how long does the player have to hit the opponent wioth their weapon to deal damage
  1055. swingrate=.4
  1056.  
  1057. clashsounds={154020979,155827029,134049906}
  1058. swooshsounds={197780401,168803294}
  1059. hitsounds={180083286,180083298,133052541}
  1060. anims={"Stab1","Stab2","LeftSlash"}
  1061.  
  1062.  
  1063.  
  1064. ready=false
  1065. equipped=false
  1066. rate=1/30
  1067. lastswing=0
  1068.  
  1069.  
  1070. function waitfor(a,b)
  1071. while a:FindFirstChild(b)==nil do
  1072. a.ChildAdded:wait()
  1073. end
  1074. return a:FindFirstChild(b)
  1075. end
  1076.  
  1077. reloading=waitfor(sp,"Reloading")
  1078. down=waitfor(sp,"MouseDown")
  1079. runanim=waitfor(sp,"RunAnim")
  1080. sparkles=waitfor(sp.Handle,"Sparkles")
  1081. debris=game:getService("Debris")
  1082. weaponhud=waitfor(sp,"WeaponHud")
  1083. weaponnametag=waitfor(weaponhud,"WeaponName")
  1084. guibar=waitfor(weaponhud,"Bar")
  1085. guibarfill=waitfor(guibar,"Fill")
  1086. weaponnametag.Text=sp.Name
  1087.  
  1088. function runsound(id,volume)
  1089. local volume=volume or 1
  1090. local sound=Instance.new("Sound")
  1091. sound.Looped=false
  1092. sound.Pitch=1.35
  1093. sound.SoundId="http://www.roblox.com/asset/?id="..tostring(id)
  1094. sound.PlayOnRemove=false
  1095. sound.Volume=volume
  1096. debris:AddItem(sound,3)
  1097. sound.Parent=sp.Handle
  1098. wait()
  1099. sound:Play()
  1100. end
  1101.  
  1102. function billboard(pos,text,time,color)
  1103. local pos=pos or Vector3.new(0,0,0)
  1104. local text=text or "Hello World!"
  1105. local time=time or 2
  1106. local color=color or Color3.new(1,0,0)
  1107. local pos=pos+Vector3.new(0,5,0)
  1108. local ep=Instance.new("Part")
  1109. ep.Name="Effect"
  1110. ep.formFactor="Custom"
  1111. ep.Size=Vector3.new(0,0,0)
  1112. ep.TopSurface="Smooth"
  1113. ep.BottomSurface="Smooth"
  1114. ep.CFrame=CFrame.new(pos)
  1115. ep.Anchored=true
  1116. ep.CanCollide=false
  1117. ep.Transparency=1
  1118. local bb=Instance.new("BillboardGui")
  1119. bb.Size=UDim2.new(3,0,3,0)
  1120. bb.Adornee=ep
  1121. bb.Active=false
  1122. local tl=Instance.new("TextLabel")
  1123. tl.BackgroundTransparency=1
  1124. tl.Size=UDim2.new(1,0,1,0)
  1125. tl.Text=text
  1126. tl.TextColor3=color
  1127. tl.TextScaled=true
  1128. tl.Font="ArialBold"
  1129. tl.Visible=false
  1130.  
  1131. tl.Parent=bb
  1132. bb.Parent=ep
  1133. debris:AddItem(ep,time+.1)
  1134. ep.Parent=game.Workspace
  1135. delay(0,function()
  1136. local frames=time/rate
  1137. for frame=1,frames do
  1138. wait(rate)
  1139. local percent=frame/frames
  1140. ep.CFrame=CFrame.new(pos)+Vector3.new(0,5*percent,0)
  1141. tl.TextTransparency=percent
  1142. end
  1143. ep:remove()
  1144. end)
  1145. end
  1146.  
  1147. function makeblood(part)
  1148. --[[
  1149. if part then
  1150. local b=Instance.new("Part")
  1151. b.BrickColor=BrickColor.new("Bright red")
  1152. b.formFactor="Custom"
  1153. b.Transparency=math.random(0,1)*.5
  1154. if math.random()<.5 then
  1155. b.CanCollide=false
  1156. else
  1157. b.CanCollide=true
  1158. end
  1159. b.TopSurface="Smooth"
  1160. b.BottomSurface="Smooth"
  1161. b.Size=Vector3.new(.2*math.random(1,5),.2*math.random(1,5),.2*math.random(1,5))
  1162. b.Velocity=part.Velocity+(Vector3.new((math.random()-.5),(math.random()-.5),(math.random()-.5))*30)
  1163. b.RotVelocity=part.RotVelocity+(Vector3.new((math.random()-.5),(math.random()-.5),(math.random()-.5))*20)
  1164. b.CFrame=part.CFrame*CFrame.new((math.random()-.5)*3,(math.random()-.5)*3,(math.random()-.5)*3)*CFrame.Angles(math.pi*2*math.random(),math.pi*2*math.random(),math.pi*2*math.random())
  1165. debris:AddItem(b,math.random()*4)
  1166. b.Parent=game.Workspace
  1167. end
  1168. --]]
  1169. end
  1170.  
  1171. sp.Handle.Touched:connect(function(hit)
  1172. if ready and equipped and hit and hit.Parent~=nil and hit:IsDescendantOf(sp.Parent)==false and string.lower(string.sub(hit.Name,1,6))~="effect" and (tick()-lastswing)<=damagewindow then
  1173. if hit:FindFirstChild("CanBlock") and sp.Handle:FindFirstChild("Blockable") then
  1174. ready=false
  1175. runsound(clashsounds[math.random(1,#clashsounds)])
  1176. sparkles.Enabled=true
  1177. delay(.2,function()
  1178. sparkles.Enabled=false
  1179. end)
  1180. billboard(sp.Handle.Position,"Block",2,Color3.new(1,1,0))
  1181. end
  1182. local mh=sp.Parent:FindFirstChild("Humanoid")
  1183. local eh=hit.Parent:FindFirstChild("Humanoid")
  1184. local ra=sp.Parent:FindFirstChild("Right Arm")
  1185. local plr=game.Players:GetPlayerFromCharacter(sp.Parent)
  1186. if mh and eh and eh~=mh and mh.Health>0 and eh.Health>0 and ra and plr~=nil then
  1187. if not plr.Neutral then
  1188. local eplr=game.Players:GetPlayerFromCharacter(eh.Parent)
  1189. if eplr~=nil and eplr.Neutral==false and eplr.TeamColor==plr.TeamColor then
  1190. return --No team killing
  1191. end
  1192. end
  1193. ready=false
  1194. for i,v in ipairs(eh:GetChildren()) do
  1195. if v.Name=="creator" then
  1196. v:remove()
  1197. end
  1198. end
  1199. local creator=Instance.new("ObjectValue")
  1200. creator.Name="creator"
  1201. creator.Value=plr
  1202. creator.Parent=eh
  1203. debris:AddItem(creator,1)
  1204. local localdamage=math.floor(damage*(.9+(math.random()*.2)))
  1205. eh:TakeDamage(localdamage)
  1206. billboard(hit.Position,"-"..tostring(localdamage))
  1207. runsound(hitsounds[math.random(1,#hitsounds)])
  1208. local bloodeffects=math.ceil(localdamage/10)
  1209. for i=1,math.random(bloodeffects-1,bloodeffects+1) do
  1210. --[[if math.random()<.5 then
  1211. makeblood(sp.Handle)
  1212. else]]
  1213. makeblood(hit)
  1214. --end
  1215. end
  1216. end
  1217. end
  1218. end)
  1219.  
  1220.  
  1221. function Activate()
  1222. if equipped and (tick()-lastswing)>=swingrate then
  1223. ready=true
  1224. reloading.Value=true
  1225.  
  1226. runsound(swooshsounds[math.random(1,#swooshsounds)],.5)
  1227.  
  1228. newanim=anims[math.random(1,#anims)]
  1229. while newanim==runanim.Value do
  1230. newanim=anims[math.random(1,#anims)]
  1231. end
  1232. runanim.Value=newanim
  1233.  
  1234. lastswing=tick()
  1235. updategui()
  1236.  
  1237. wait(swingrate)
  1238.  
  1239. reloading.Value=false
  1240. if down.Value then
  1241. Activate()
  1242. end
  1243. end
  1244. end
  1245.  
  1246. down.Changed:connect(function()
  1247. if down.Value then
  1248. Activate()
  1249. end
  1250. end)
  1251.  
  1252. function updategui()
  1253. local swingpercent=math.min((tick()-lastswing)/swingrate,1)
  1254. if swingpercent<.5 then --fade from red to yellow then to green
  1255. guibarfill.BackgroundColor3=Color3.new(1,swingpercent*2,0)
  1256. else
  1257. guibarfill.BackgroundColor3=Color3.new(1-((swingpercent-.5)/.5),1,0)
  1258. end
  1259. guibarfill.Size=UDim2.new(swingpercent,0,1,0)
  1260. end
  1261.  
  1262. sp.Equipped:connect(function(mouse)
  1263. lastswing=tick()
  1264. updategui()
  1265.  
  1266. reloading.Value=true
  1267. ready=false
  1268. equipped=true
  1269.  
  1270. delay(0,function() --HAAB (Hacking around a bug)
  1271. local plr=game.Players:GetPlayerFromCharacter(sp.Parent)
  1272. if plr~=nil then
  1273. local plrgui=plr:FindFirstChild("PlayerGui")
  1274. if plrgui~=nil and weaponhud~=nil then
  1275. weaponhud.Parent=plrgui
  1276. while equipped do
  1277. updategui()
  1278. wait(rate)
  1279. end
  1280. end
  1281. end
  1282. end)
  1283.  
  1284. wait(swingrate)
  1285.  
  1286. reloading.Value=false
  1287. if down.Value then
  1288. Activate()
  1289. end
  1290. end)
  1291.  
  1292. sp.Unequipped:connect(function()
  1293. ready=false
  1294. equipped=false
  1295. delay(0,function() --HAAB
  1296. weaponhud.Parent=sp
  1297. end)
  1298. end)
  1299.  
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305.  
  1306.  
  1307. end))
  1308. CornerWedgePart57.Parent = Tool0
  1309. CornerWedgePart57.Material = Enum.Material.Ice
  1310. CornerWedgePart57.BrickColor = BrickColor.new("Medium blue")
  1311. CornerWedgePart57.Rotation = Vector3.new(-16.6000004, 5.46000004, 136.720001)
  1312. CornerWedgePart57.Size = Vector3.new(0.140881032, 0.352202654, 0.140881032)
  1313. CornerWedgePart57.CFrame = CFrame.new(45.8371544, 5.87581348, -12.9178791, -0.72467196, -0.682498157, 0.0951149613, 0.676821768, -0.679019213, 0.284332901, -0.129471824, 0.270423949, 0.953995645)
  1314. CornerWedgePart57.Color = Color3.new(0.431373, 0.6, 0.792157)
  1315. CornerWedgePart57.Position = Vector3.new(45.8371544, 5.87581348, -12.9178791)
  1316. CornerWedgePart57.Orientation = Vector3.new(-16.5200005, 5.69000006, 135.089996)
  1317. CornerWedgePart57.Color = Color3.new(0.431373, 0.6, 0.792157)
  1318. CornerWedgePart58.Parent = Tool0
  1319. CornerWedgePart58.Material = Enum.Material.Ice
  1320. CornerWedgePart58.BrickColor = BrickColor.new("Medium blue")
  1321. CornerWedgePart58.Rotation = Vector3.new(79.1699982, 46.4399986, 82.0699997)
  1322. CornerWedgePart58.Size = Vector3.new(0.140881032, 0.352202654, 0.140881032)
  1323. CornerWedgePart58.CFrame = CFrame.new(45.8237572, 5.83575726, -13.0522785, 0.0951149613, -0.682498157, 0.72467196, 0.284332901, -0.679019213, -0.676821768, 0.953995645, 0.270423949, 0.129471824)
  1324. CornerWedgePart58.Color = Color3.new(0.431373, 0.6, 0.792157)
  1325. CornerWedgePart58.Position = Vector3.new(45.8237572, 5.83575726, -13.0522785)
  1326. CornerWedgePart58.Orientation = Vector3.new(42.5999985, 79.8699951, 157.279999)
  1327. CornerWedgePart58.Color = Color3.new(0.431373, 0.6, 0.792157)
  1328. CornerWedgePart59.Parent = Tool0
  1329. CornerWedgePart59.Material = Enum.Material.Ice
  1330. CornerWedgePart59.BrickColor = BrickColor.new("Medium blue")
  1331. CornerWedgePart59.Rotation = Vector3.new(-100.829994, -46.4399986, 97.9300003)
  1332. CornerWedgePart59.Size = Vector3.new(0.140881032, 0.352202654, 0.140881032)
  1333. CornerWedgePart59.CFrame = CFrame.new(45.7350616, 5.97116518, -12.9361191, -0.0951149613, -0.682498157, -0.72467196, -0.284332901, -0.679019213, 0.676821768, -0.953995645, 0.270423949, -0.129471824)
  1334. CornerWedgePart59.Color = Color3.new(0.431373, 0.6, 0.792157)
  1335. CornerWedgePart59.Position = Vector3.new(45.7350616, 5.97116518, -12.9361191)
  1336. CornerWedgePart59.Orientation = Vector3.new(-42.5999985, -100.129997, -157.279999)
  1337. CornerWedgePart59.Color = Color3.new(0.431373, 0.6, 0.792157)
  1338. Part60.Parent = Tool0
  1339. Part60.Material = Enum.Material.Metal
  1340. Part60.BrickColor = BrickColor.new("Black")
  1341. Part60.Rotation = Vector3.new(72.1199951, -13.2199993, 84.3899994)
  1342. Part60.FormFactor = Enum.FormFactor.Custom
  1343. Part60.Size = Vector3.new(2.49999833, 0.0999999493, 0.0999999493)
  1344. Part60.CFrame = CFrame.new(45.7174721, 5.66505098, -14.4666691, 0.0951151401, -0.968833447, -0.228724658, 0.284334123, 0.246635124, -0.926458538, 0.953995466, 0.0230860114, 0.298931152)
  1345. Part60.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  1346. Part60.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  1347. Part60.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  1348. Part60.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  1349. Part60.RightSurface = Enum.SurfaceType.SmoothNoOutlines
  1350. Part60.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  1351. Part60.Color = Color3.new(0.105882, 0.164706, 0.207843)
  1352. Part60.Position = Vector3.new(45.7174721, 5.66505098, -14.4666691)
  1353. Part60.Orientation = Vector3.new(67.8899994, -37.4199982, 49.0599976)
  1354. Part60.Color = Color3.new(0.105882, 0.164706, 0.207843)
  1355. SpecialMesh61.Parent = Part60
  1356. SpecialMesh61.MeshType = Enum.MeshType.Cylinder
  1357. Part62.Parent = Tool0
  1358. Part62.Material = Enum.Material.Metal
  1359. Part62.BrickColor = BrickColor.new("Black")
  1360. Part62.Rotation = Vector3.new(72.1199951, -13.2199993, 84.3899994)
  1361. Part62.FormFactor = Enum.FormFactor.Custom
  1362. Part62.Size = Vector3.new(0.0825000033, 0.0825000033, 0.0825000033)
  1363. Part62.CFrame = CFrame.new(45.8316116, 6.00625515, -13.3218632, 0.0951151401, -0.968833447, -0.228724658, 0.284334123, 0.246635124, -0.926458538, 0.953995466, 0.0230860114, 0.298931152)
  1364. Part62.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  1365. Part62.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  1366. Part62.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  1367. Part62.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  1368. Part62.RightSurface = Enum.SurfaceType.SmoothNoOutlines
  1369. Part62.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  1370. Part62.Color = Color3.new(0.105882, 0.164706, 0.207843)
  1371. Part62.Position = Vector3.new(45.8316116, 6.00625515, -13.3218632)
  1372. Part62.Orientation = Vector3.new(67.8899994, -37.4199982, 49.0599976)
  1373. Part62.Color = Color3.new(0.105882, 0.164706, 0.207843)
  1374. SpecialMesh63.Parent = Part62
  1375. SpecialMesh63.MeshType = Enum.MeshType.Sphere
  1376. Script64.Name = "qPerfectionWeld"
  1377. Script64.Parent = Tool0
  1378. table.insert(cors,sandbox(Script64,function()
  1379. -- Created by Quenty (@Quenty, follow me on twitter).
  1380. -- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
  1381. -- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
  1382.  
  1383. --[[ INSTRUCTIONS
  1384. - Place in the model
  1385. - Make sure model is anchored
  1386. - That's it. It will weld the model and all children.
  1387.  
  1388. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1389. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1390. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1391. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1392. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1393. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1394. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1395. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1396.  
  1397. 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.
  1398. ]]
  1399.  
  1400. --[[ DOCUMENTATION
  1401. - 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.
  1402. - Will work in PBS servers
  1403. - Will work as long as it starts out with the part anchored
  1404. - Stores the relative CFrame as a CFrame value
  1405. - Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
  1406. - Utilizes a recursive algorith to find all parts in the model
  1407. - Will reweld on script reparent if the script is initially parented to a tool.
  1408. - Welds as fast as possible
  1409. ]]
  1410.  
  1411. -- qPerfectionWeld.lua
  1412. -- Created 10/6/2014
  1413. -- Author: Quenty
  1414. -- Version 1.0.3
  1415.  
  1416. -- Updated 10/14/2014 - Updated to 1.0.1
  1417. --- Bug fix with existing ROBLOX welds ? Repro by asimo3089
  1418.  
  1419. -- Updated 10/14/2014 - Updated to 1.0.2
  1420. --- Fixed bug fix.
  1421.  
  1422. -- Updated 10/14/2014 - Updated to 1.0.3
  1423. --- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
  1424.  
  1425. 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).
  1426.  
  1427.  
  1428. local function CallOnChildren(Instance, FunctionToCall)
  1429. -- Calls a function on each of the children of a certain object, using recursion.
  1430.  
  1431. FunctionToCall(Instance)
  1432.  
  1433. for _, Child in next, Instance:GetChildren() do
  1434. CallOnChildren(Child, FunctionToCall)
  1435. end
  1436. end
  1437.  
  1438. local function GetNearestParent(Instance, ClassName)
  1439. -- Returns the nearest parent of a certain class, or returns nil
  1440.  
  1441. local Ancestor = Instance
  1442. repeat
  1443. Ancestor = Ancestor.Parent
  1444. if Ancestor == nil then
  1445. return nil
  1446. end
  1447. until Ancestor:IsA(ClassName)
  1448.  
  1449. return Ancestor
  1450. end
  1451.  
  1452. local function GetBricks(StartInstance)
  1453. local List = {}
  1454.  
  1455. -- if StartInstance:IsA("BasePart") then
  1456. -- List[#List+1] = StartInstance
  1457. -- end
  1458.  
  1459. CallOnChildren(StartInstance, function(Item)
  1460. if Item:IsA("BasePart") then
  1461. List[#List+1] = Item;
  1462. end
  1463. end)
  1464.  
  1465. return List
  1466. end
  1467.  
  1468. local function Modify(Instance, Values)
  1469. -- Modifies an Instance by using a table.
  1470.  
  1471. assert(type(Values) == "table", "Values is not a table");
  1472.  
  1473. for Index, Value in next, Values do
  1474. if type(Index) == "number" then
  1475. Value.Parent = Instance
  1476. else
  1477. Instance[Index] = Value
  1478. end
  1479. end
  1480. return Instance
  1481. end
  1482.  
  1483. local function Make(ClassType, Properties)
  1484. -- Using a syntax hack to create a nice way to Make new items.
  1485.  
  1486. return Modify(Instance.new(ClassType), Properties)
  1487. end
  1488.  
  1489. local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
  1490. local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
  1491.  
  1492. local function HasWheelJoint(Part)
  1493. for _, SurfaceName in pairs(Surfaces) do
  1494. for _, HingSurfaceName in pairs(HingSurfaces) do
  1495. if Part[SurfaceName].Name == HingSurfaceName then
  1496. return true
  1497. end
  1498. end
  1499. end
  1500.  
  1501. return false
  1502. end
  1503.  
  1504. local function ShouldBreakJoints(Part)
  1505. --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
  1506. -- definitely some edge cases.
  1507.  
  1508. if NEVER_BREAK_JOINTS then
  1509. return false
  1510. end
  1511.  
  1512. if HasWheelJoint(Part) then
  1513. return false
  1514. end
  1515.  
  1516. local Connected = Part:GetConnectedParts()
  1517.  
  1518. if #Connected == 1 then
  1519. return false
  1520. end
  1521.  
  1522. for _, Item in pairs(Connected) do
  1523. if HasWheelJoint(Item) then
  1524. return false
  1525. elseif not Item:IsDescendantOf(script.Parent) then
  1526. return false
  1527. end
  1528. end
  1529.  
  1530. return true
  1531. end
  1532.  
  1533. local function WeldTogether(Part0, Part1, JointType, WeldParent)
  1534. --- Weld's 2 parts together
  1535. -- @param Part0 The first part
  1536. -- @param Part1 The second part (Dependent part most of the time).
  1537. -- @param [JointType] The type of joint. Defaults to weld.
  1538. -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
  1539. -- @return The weld created.
  1540.  
  1541. JointType = JointType or "Weld"
  1542. local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
  1543.  
  1544. local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
  1545. Modify(NewWeld, {
  1546. Name = "qCFrameWeldThingy";
  1547. Part0 = Part0;
  1548. Part1 = Part1;
  1549. C0 = CFrame.new();--Part0.CFrame:inverse();
  1550. C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
  1551. Parent = Part1;
  1552. })
  1553.  
  1554. if not RelativeValue then
  1555. RelativeValue = Make("CFrameValue", {
  1556. Parent = Part1;
  1557. Name = "qRelativeCFrameWeldValue";
  1558. Archivable = true;
  1559. Value = NewWeld.C1;
  1560. })
  1561. end
  1562.  
  1563. return NewWeld
  1564. end
  1565.  
  1566. local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
  1567. -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
  1568. -- @param MainPart The part to weld the model to (can be in the model).
  1569. -- @param [JointType] The type of joint. Defaults to weld.
  1570. -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
  1571.  
  1572. for _, Part in pairs(Parts) do
  1573. if ShouldBreakJoints(Part) then
  1574. Part:BreakJoints()
  1575. end
  1576. end
  1577.  
  1578. for _, Part in pairs(Parts) do
  1579. if Part ~= MainPart then
  1580. WeldTogether(MainPart, Part, JointType, MainPart)
  1581. end
  1582. end
  1583.  
  1584. if not DoNotUnanchor then
  1585. for _, Part in pairs(Parts) do
  1586. Part.Anchored = false
  1587. end
  1588. MainPart.Anchored = false
  1589. end
  1590. end
  1591.  
  1592. local function PerfectionWeld()
  1593. local Tool = GetNearestParent(script, "Tool")
  1594.  
  1595. local Parts = GetBricks(script.Parent)
  1596. 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]
  1597.  
  1598. if PrimaryPart then
  1599. WeldParts(Parts, PrimaryPart, "Weld", false)
  1600. else
  1601. warn("qWeld - Unable to weld part")
  1602. end
  1603.  
  1604. return Tool
  1605. end
  1606.  
  1607. local Tool = PerfectionWeld()
  1608.  
  1609.  
  1610. if Tool and script.ClassName == "Script" then
  1611. --- Don't bother with local scripts
  1612.  
  1613. script.Parent.AncestryChanged:connect(function()
  1614. PerfectionWeld()
  1615. end)
  1616. end
  1617.  
  1618. -- Created by Quenty (@Quenty, follow me on twitter).
  1619.  
  1620. end))
  1621. for i,v in pairs(mas:GetChildren()) do
  1622. v.Parent = game:GetService("Players").LocalPlayer.Backpack
  1623. pcall(function() v:MakeJoints() end)
  1624. end
  1625. mas:Destroy()
  1626. for i,v in pairs(cors) do
  1627. spawn(function()
  1628. pcall(v)
  1629. end)
  1630. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement