Advertisement
H3VL

Gears

Feb 3rd, 2018
479
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 35.03 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. SpecialMesh2 = Instance.new("SpecialMesh")
  22. Sound3 = Instance.new("Sound")
  23. LocalScript4 = Instance.new("LocalScript")
  24. Tool5 = Instance.new("Tool")
  25. Script6 = Instance.new("Script")
  26. Part7 = Instance.new("Part")
  27. SpecialMesh8 = Instance.new("SpecialMesh")
  28. Sound9 = Instance.new("Sound")
  29. Sound10 = Instance.new("Sound")
  30. Sound11 = Instance.new("Sound")
  31. Sound12 = Instance.new("Sound")
  32. Sound13 = Instance.new("Sound")
  33. Sound14 = Instance.new("Sound")
  34. Sound15 = Instance.new("Sound")
  35. Sound16 = Instance.new("Sound")
  36. Sound17 = Instance.new("Sound")
  37. Sound18 = Instance.new("Sound")
  38. Sound19 = Instance.new("Sound")
  39. Sound20 = Instance.new("Sound")
  40. Sound21 = Instance.new("Sound")
  41. Sound22 = Instance.new("Sound")
  42. Sound23 = Instance.new("Sound")
  43. Sound24 = Instance.new("Sound")
  44. Sound25 = Instance.new("Sound")
  45. Sound26 = Instance.new("Sound")
  46. LocalScript27 = Instance.new("LocalScript")
  47. Tool28 = Instance.new("Tool")
  48. LocalScript29 = Instance.new("LocalScript")
  49. Part30 = Instance.new("Part")
  50. Tool31 = Instance.new("Tool")
  51. Part32 = Instance.new("Part")
  52. SpecialMesh33 = Instance.new("SpecialMesh")
  53. Sound34 = Instance.new("Sound")
  54. Sound35 = Instance.new("Sound")
  55. PointLight36 = Instance.new("PointLight")
  56. LocalScript37 = Instance.new("LocalScript")
  57. Sound38 = Instance.new("Sound")
  58. LocalScript39 = Instance.new("LocalScript")
  59. Script40 = Instance.new("Script")
  60. Tool41 = Instance.new("Tool")
  61. BoolValue42 = Instance.new("BoolValue")
  62. BoolValue43 = Instance.new("BoolValue")
  63. BoolValue44 = Instance.new("BoolValue")
  64. LocalScript45 = Instance.new("LocalScript")
  65. LocalScript46 = Instance.new("LocalScript")
  66. Part47 = Instance.new("Part")
  67. SpecialMesh48 = Instance.new("SpecialMesh")
  68. Sound49 = Instance.new("Sound")
  69. Sound50 = Instance.new("Sound")
  70. Sound51 = Instance.new("Sound")
  71. Sound52 = Instance.new("Sound")
  72. Sound53 = Instance.new("Sound")
  73. Animation54 = Instance.new("Animation")
  74. Animation55 = Instance.new("Animation")
  75. Animation56 = Instance.new("Animation")
  76. Animation57 = Instance.new("Animation")
  77. Animation58 = Instance.new("Animation")
  78. Script59 = Instance.new("Script")
  79. Animation60 = Instance.new("Animation")
  80. Tool0.Name = "BoomboxGearThree"
  81. Tool0.Parent = mas
  82. Tool0.TextureId = "http://www.roblox.com/asset/?id=192488987 "
  83. Tool0.GripForward = Vector3.new(1, -0, -0)
  84. Tool0.GripPos = Vector3.new(1, -1.25, 0)
  85. Tool0.GripRight = Vector3.new(0, 0, 1)
  86. Part1.Name = "Handle"
  87. Part1.Parent = Tool0
  88. Part1.CanCollide = false
  89. Part1.FormFactor = Enum.FormFactor.Custom
  90. Part1.Size = Vector3.new(3.20000005, 1.60000002, 1.20000005)
  91. Part1.CFrame = CFrame.new(11.29, 0.800014019, -0.0900000036, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  92. Part1.BottomSurface = Enum.SurfaceType.Smooth
  93. Part1.TopSurface = Enum.SurfaceType.Smooth
  94. Part1.Position = Vector3.new(11.29, 0.800014019, -0.0900000036)
  95. SpecialMesh2.Parent = Part1
  96. SpecialMesh2.MeshId = "http://www.roblox.com/asset/?id=192488915 "
  97. SpecialMesh2.TextureId = "http://www.roblox.com/asset/?id=192488947 "
  98. SpecialMesh2.MeshType = Enum.MeshType.FileMesh
  99. Sound3.Parent = Part1
  100. Sound3.Volume = 1
  101. Sound3.Looped = true
  102. LocalScript4.Name = "Client"
  103. LocalScript4.Parent = Tool0
  104. table.insert(cors,sandbox(LocalScript4,function()
  105. wait(1)
  106.  
  107. local Tool = script.Parent
  108. local songgui
  109. Sound = Tool.Handle:FindFirstChild("Sound")
  110.  
  111. local Player = game:GetService("Players").LocalPlayer
  112. local Mouse = Player:GetMouse()
  113.  
  114.  
  115. Tool.Unequipped:connect(function()
  116. if songgui then
  117. songgui:Destroy()
  118. end
  119. Sound:Stop()
  120. end)
  121.  
  122.  
  123. Tool.Equipped:connect(function()
  124. if Player.PlayerGui:FindFirstChild("ChooseSongGui") then return end
  125.  
  126. local sg = Instance.new("ScreenGui")
  127. sg.Name = "ChooseSongGui"
  128.  
  129. local frame = Instance.new("Frame")
  130. frame.Style = "RobloxRound"
  131. frame.Size = UDim2.new(0.25, 0, 0.25, 0)
  132. frame.Position = UDim2.new((1-frame.Size.X.Scale)/2, 0, (1-frame.Size.Y.Scale)/2, 0)
  133. frame.Parent = sg
  134. frame.Draggable = true
  135.  
  136. local text = Instance.new("TextLabel")
  137. text.BackgroundTransparency = 1
  138. text.TextStrokeTransparency = 0
  139. text.TextColor3 = Color3.new(1, 1, 1)
  140. text.Size = UDim2.new(1, 0, 0.6, 0)
  141. text.TextScaled = true
  142. text.Text = "Lay down the beat!\nPut in the ID number for a song you love that's been uploaded to ROBLOX.\nLeave it blank to stop playing music."
  143. text.Parent = frame
  144.  
  145. local input = Instance.new("TextBox")
  146. input.BackgroundColor3 = Color3.new(0, 0, 0)
  147. input.BackgroundTransparency = 0.5
  148. input.BorderColor3 = Color3.new(1, 1, 1)
  149. input.TextColor3 = Color3.new(1, 1, 1)
  150. input.TextStrokeTransparency = 1
  151. input.TextScaled = true
  152. input.Text = "142376088"
  153. input.Size = UDim2.new(1, 0, 0.2, 0)
  154. input.Position = UDim2.new(0, 0, 0.6, 0)
  155. input.Parent = frame
  156.  
  157. local button = Instance.new("TextButton")
  158. button.Style = "RobloxButton"
  159. button.Size = UDim2.new(0.75, 0, 0.2, 0)
  160. button.Position = UDim2.new(0.125, 0, 0.8, 0)
  161. button.TextColor3 = Color3.new(1, 1, 1)
  162. button.TextStrokeTransparency = 0
  163. button.Text = "Play!"
  164. button.TextScaled = true
  165. button.Parent = frame
  166. button.MouseButton1Click:connect(function()
  167. if Sound then
  168. Sound:Stop()
  169. end
  170. Sound.Parent = Tool.Handle
  171. Sound.Volume = 4
  172. Sound.EmitterSize = 14
  173. Sound.Looped = true
  174. Sound.PlayOnRemove = false
  175. Sound.SoundId = "http://www.roblox.com/asset/?id="..input.Text
  176. Sound:Play()
  177. sg:Destroy()
  178. end)
  179.  
  180. sg.Parent = Player.PlayerGui
  181.  
  182. songgui = sg
  183. end)
  184. --connect
  185.  
  186. end))
  187. Tool5.Name = "Darkheart"
  188. Tool5.Parent = mas
  189. Tool5.GripForward = Vector3.new(-1, -0, -0)
  190. Tool5.GripPos = Vector3.new(0, 0, -1.5)
  191. Tool5.GripRight = Vector3.new(0, 1, 0)
  192. Tool5.GripUp = Vector3.new(0, 0, 1)
  193. Script6.Name = "SwordScript"
  194. Script6.Parent = Tool5
  195. table.insert(cors,sandbox(Script6,function()
  196. -------- OMG HAX
  197.  
  198. r = game:service("RunService")
  199.  
  200.  
  201. local damage = 7
  202.  
  203.  
  204. local slash_damage = 16
  205. local lunge_damage = 22
  206.  
  207. sword = script.Parent.Handle
  208. Tool = script.Parent
  209.  
  210.  
  211. local SlashSound = Instance.new("Sound")
  212. SlashSound.SoundId = "rbxasset://sounds\\swordslash.wav"
  213. SlashSound.Parent = sword
  214. SlashSound.Volume = .7
  215.  
  216. local LungeSound = Instance.new("Sound")
  217. LungeSound.SoundId = "rbxasset://sounds\\swordlunge.wav"
  218. LungeSound.Parent = sword
  219. LungeSound.Volume = .6
  220.  
  221. local UnsheathSound = Instance.new("Sound")
  222. UnsheathSound.SoundId = "rbxasset://sounds\\unsheath.wav"
  223. UnsheathSound.Parent = sword
  224. UnsheathSound.Volume = 1
  225.  
  226. function DarkKill(character, humanoid, attacker)
  227.  
  228. if (character:FindFirstChild("ForceField") ~= nil) then return end
  229.  
  230. local childs = character:GetChildren()
  231.  
  232. local colors = {}
  233.  
  234. tagHumanoid(humanoid, attacker)
  235. humanoid.Health = 0
  236.  
  237. for i=1,#childs do
  238. if (childs[i].className == "Part") then
  239. colors[i] = childs[i].BrickColor
  240. childs[i].BrickColor = BrickColor.new(26)
  241. childs[i].CanCollide = true
  242. childs[i].Anchored = true
  243. end
  244. end
  245.  
  246. wait(.25)
  247.  
  248. for i=1,#childs do
  249. if (childs[i].className == "Part") then
  250. local b = Instance.new("BodyVelocity")
  251. b.velocity = Vector3.new(math.random() - .5, 0, math.random() - .5).unit * 80
  252. b.maxForce = Vector3.new(1e5,1e5,1e5)
  253. b.Parent = childs[i]
  254. end
  255. end
  256.  
  257. for i=1,#childs do
  258. if (childs[i].className == "Part") then
  259. childs[i].Anchored = false
  260. end
  261. end
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270. end
  271.  
  272.  
  273.  
  274.  
  275. function blow(hit)
  276. local humanoid = hit.Parent:findFirstChild("Humanoid")
  277. local vCharacter = Tool.Parent
  278. local vPlayer = game.Players:playerFromCharacter(vCharacter)
  279. local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
  280. if humanoid~=nil and humanoid ~= hum and hum ~= nil then
  281. -- final check, make sure sword is in-hand
  282.  
  283. local right_arm = vCharacter:FindFirstChild("Right Arm")
  284. if (right_arm ~= nil) then
  285. local joint = right_arm:FindFirstChild("RightGrip")
  286. if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
  287. hum.Health = hum.Health + (damage * .3)
  288. if humanoid.Health > damage then
  289. tagHumanoid(humanoid, vPlayer)
  290. humanoid:TakeDamage(damage)
  291. wait(1)
  292. untagHumanoid(humanoid)
  293. else
  294. DarkKill(humanoid.Parent, humanoid, vPlayer)
  295. end
  296. end
  297. end
  298.  
  299.  
  300. end
  301. end
  302.  
  303.  
  304.  
  305. function tagHumanoid(humanoid, player)
  306. local creator_tag = Instance.new("ObjectValue")
  307. creator_tag.Value = player
  308. creator_tag.Name = "creator"
  309. creator_tag.Parent = humanoid
  310. end
  311.  
  312. function untagHumanoid(humanoid)
  313. if humanoid ~= nil then
  314. local tag = humanoid:findFirstChild("creator")
  315. if tag ~= nil then
  316. tag.Parent = nil
  317. end
  318. end
  319. end
  320.  
  321.  
  322. function attack()
  323. damage = slash_damage
  324. SlashSound:play()
  325. local anim = Instance.new("StringValue")
  326. anim.Name = "toolanim"
  327. anim.Value = "Slash"
  328. anim.Parent = Tool
  329. end
  330.  
  331. function lunge()
  332. damage = lunge_damage
  333.  
  334. LungeSound:play()
  335.  
  336. local anim = Instance.new("StringValue")
  337. anim.Name = "toolanim"
  338. anim.Value = "Lunge"
  339. anim.Parent = Tool
  340.  
  341.  
  342. local force = Instance.new("BodyVelocity")
  343. force.velocity = Vector3.new(0,10,0) --Tool.Parent.Torso.CFrame.lookVector * 80
  344. force.Parent = Tool.Parent.Torso
  345. wait(.25)
  346. swordOut()
  347. wait(.25)
  348. force.Parent = nil
  349. wait(.5)
  350. swordUp()
  351.  
  352. damage = slash_damage
  353. end
  354.  
  355. function swordUp()
  356. Tool.GripForward = Vector3.new(-1,0,0)
  357. Tool.GripRight = Vector3.new(0,1,0)
  358. Tool.GripUp = Vector3.new(0,0,1)
  359. end
  360.  
  361. function swordOut()
  362. Tool.GripForward = Vector3.new(0,0,1)
  363. Tool.GripRight = Vector3.new(0,-1,0)
  364. Tool.GripUp = Vector3.new(-1,0,0)
  365. end
  366.  
  367. function swordAcross()
  368. -- parry
  369. end
  370.  
  371.  
  372. Tool.Enabled = true
  373. local last_attack = 0
  374. function onActivated()
  375.  
  376. if not Tool.Enabled then
  377. return
  378. end
  379.  
  380. Tool.Enabled = false
  381.  
  382. local character = Tool.Parent;
  383. local humanoid = character.Humanoid
  384. if humanoid == nil then
  385. print("Humanoid not found")
  386. return
  387. end
  388.  
  389. t = r.Stepped:wait()
  390.  
  391. if (t - last_attack < .2) then
  392. lunge()
  393. else
  394. attack()
  395. end
  396.  
  397. last_attack = t
  398.  
  399. --wait(.5)
  400.  
  401. Tool.Enabled = true
  402. end
  403.  
  404.  
  405. function onEquipped()
  406. UnsheathSound:play()
  407. end
  408.  
  409.  
  410. script.Parent.Activated:connect(onActivated)
  411. script.Parent.Equipped:connect(onEquipped)
  412.  
  413.  
  414. connection = sword.Touched:connect(blow)
  415.  
  416.  
  417.  
  418. end))
  419. Part7.Name = "Handle"
  420. Part7.Parent = Tool5
  421. Part7.BrickColor = BrickColor.new("Dark stone grey")
  422. Part7.Reflectance = 0.69999998807907
  423. Part7.Rotation = Vector3.new(90, 0, 0)
  424. Part7.FormFactor = Enum.FormFactor.Plate
  425. Part7.Size = Vector3.new(1, 0.800000012, 4)
  426. Part7.CFrame = CFrame.new(28.0499992, 2.00001407, -7.3000021, 1, 1.21649741e-18, 8.69960326e-19, 8.69961463e-19, -9.53674316e-07, -0.99999994, -1.21649648e-18, 0.99999994, -9.53674316e-07)
  427. Part7.BottomSurface = Enum.SurfaceType.Smooth
  428. Part7.TopSurface = Enum.SurfaceType.Smooth
  429. Part7.Color = Color3.new(0.388235, 0.372549, 0.384314)
  430. Part7.Position = Vector3.new(28.0499992, 2.00001407, -7.3000021)
  431. Part7.Orientation = Vector3.new(89.9799957, 180, 180)
  432. Part7.Color = Color3.new(0.388235, 0.372549, 0.384314)
  433. SpecialMesh8.Parent = Part7
  434. SpecialMesh8.MeshId = "http://www.roblox.com/asset/?id=12221720"
  435. SpecialMesh8.Scale = Vector3.new(0.800000012, 0.800000012, 1)
  436. SpecialMesh8.TextureId = "http://www.roblox.com/asset/?id=12224218"
  437. SpecialMesh8.VertexColor = Vector3.new(0, 0, 0)
  438. SpecialMesh8.MeshType = Enum.MeshType.FileMesh
  439. SpecialMesh8.Scale = Vector3.new(0.800000012, 0.800000012, 1)
  440. Sound9.Parent = Part7
  441. Sound9.SoundId = "rbxasset://sounds/swordslash.wav"
  442. Sound9.Volume = 0.69999998807907
  443. Sound10.Parent = Part7
  444. Sound10.SoundId = "rbxasset://sounds/swordlunge.wav"
  445. Sound10.Volume = 0.60000002384186
  446. Sound11.Parent = Part7
  447. Sound11.SoundId = "rbxasset://sounds/unsheath.wav"
  448. Sound11.Volume = 1
  449. Sound12.Parent = Part7
  450. Sound12.SoundId = "rbxasset://sounds/swordslash.wav"
  451. Sound12.Volume = 0.69999998807907
  452. Sound13.Parent = Part7
  453. Sound13.SoundId = "rbxasset://sounds/swordlunge.wav"
  454. Sound13.Volume = 0.60000002384186
  455. Sound14.Parent = Part7
  456. Sound14.SoundId = "rbxasset://sounds/unsheath.wav"
  457. Sound14.Volume = 1
  458. Sound15.Parent = Part7
  459. Sound15.SoundId = "rbxasset://sounds/swordslash.wav"
  460. Sound15.Volume = 0.69999998807907
  461. Sound16.Parent = Part7
  462. Sound16.SoundId = "rbxasset://sounds/swordlunge.wav"
  463. Sound16.Volume = 0.60000002384186
  464. Sound17.Parent = Part7
  465. Sound17.SoundId = "rbxasset://sounds/unsheath.wav"
  466. Sound17.Volume = 1
  467. Sound18.Parent = Part7
  468. Sound18.SoundId = "rbxasset://sounds/swordslash.wav"
  469. Sound18.Volume = 0.69999998807907
  470. Sound19.Parent = Part7
  471. Sound19.SoundId = "rbxasset://sounds/swordlunge.wav"
  472. Sound19.Volume = 0.60000002384186
  473. Sound20.Parent = Part7
  474. Sound20.SoundId = "rbxasset://sounds/unsheath.wav"
  475. Sound20.Volume = 1
  476. Sound21.Parent = Part7
  477. Sound21.SoundId = "rbxasset://sounds/swordslash.wav"
  478. Sound21.Volume = 0.69999998807907
  479. Sound22.Parent = Part7
  480. Sound22.SoundId = "rbxasset://sounds/swordlunge.wav"
  481. Sound22.Volume = 0.60000002384186
  482. Sound23.Parent = Part7
  483. Sound23.SoundId = "rbxasset://sounds/unsheath.wav"
  484. Sound23.Volume = 1
  485. Sound24.Parent = Part7
  486. Sound24.SoundId = "rbxasset://sounds/swordslash.wav"
  487. Sound24.Volume = 0.69999998807907
  488. Sound25.Parent = Part7
  489. Sound25.SoundId = "rbxasset://sounds/swordlunge.wav"
  490. Sound25.Volume = 0.60000002384186
  491. Sound26.Parent = Part7
  492. Sound26.SoundId = "rbxasset://sounds/unsheath.wav"
  493. Sound26.Volume = 1
  494. LocalScript27.Name = "Local Gui"
  495. LocalScript27.Parent = Tool5
  496. Tool28.Name = "Handcuffs"
  497. Tool28.Parent = mas
  498. Tool28.GripForward = Vector3.new(-0, -0, 1)
  499. Tool28.GripRight = Vector3.new(0, 1, 0)
  500. Tool28.GripUp = Vector3.new(1, 0, 0)
  501. LocalScript29.Parent = Tool28
  502. table.insert(cors,sandbox(LocalScript29,function()
  503. script.Parent.Equipped:connect(function(m)
  504. m.Button1Down:connect(function()
  505. if m.Target~=nil then
  506. print(m.Target:GetFullName())
  507. p=nil
  508. _,p=pcall(function() return game.Players[m.Target.Parent.Name] end)
  509. print(p)
  510. print(m.Target.Parent.Name)
  511. if p~=nil then
  512. local detained=p
  513. coroutine.wrap(function()
  514. local c=p
  515. while p==c do wait() pcall(function()
  516. p.Character.Torso.Anchored,p.Character.Torso.CFrame=true,game.Players.LocalPlayer.Character.Torso.CFrame*CFrame.new(0,0,-2.5)
  517. end) end
  518. print('END OF DETAIN LOOP')
  519. pcall(function() c.Character.Torso.Anchored=false end)
  520. end)()
  521. else print('no p') end
  522. end
  523. end)
  524. end)
  525. end))
  526. Part30.Name = "Handle"
  527. Part30.Parent = Tool28
  528. Part30.Size = Vector3.new(0.960001051, 1, 0.940000176)
  529. Part30.CFrame = CFrame.new(-31.9100113, 0.500003994, 5.30000114, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  530. Part30.BottomSurface = Enum.SurfaceType.Smooth
  531. Part30.TopSurface = Enum.SurfaceType.Smooth
  532. Part30.Position = Vector3.new(-31.9100113, 0.500003994, 5.30000114)
  533. Tool31.Name = "LaserGun"
  534. Tool31.Parent = mas
  535. Tool31.TextureId = "http://www.roblox.com/asset?id=130093050"
  536. Tool31.GripPos = Vector3.new(0, -0.100000001, 0.75)
  537. Tool31.CanBeDropped = false
  538. Part32.Name = "Handle"
  539. Part32.Parent = Tool31
  540. Part32.Rotation = Vector3.new(-180, 0, -180)
  541. Part32.CanCollide = false
  542. Part32.FormFactor = Enum.FormFactor.Custom
  543. Part32.Size = Vector3.new(0.580000222, 1.34000099, 2.48000145)
  544. Part32.CFrame = CFrame.new(32.1100006, 0.670002997, 6.46999979, -1, 0, 0, 0, 1, 0, 0, 0, -1)
  545. Part32.BottomSurface = Enum.SurfaceType.Smooth
  546. Part32.TopSurface = Enum.SurfaceType.Smooth
  547. Part32.Position = Vector3.new(32.1100006, 0.670002997, 6.46999979)
  548. Part32.Orientation = Vector3.new(0, 180, 0)
  549. SpecialMesh33.Parent = Part32
  550. SpecialMesh33.MeshId = "http://www.roblox.com/asset?id=130099641"
  551. SpecialMesh33.Scale = Vector3.new(0.649999976, 0.649999976, 0.649999976)
  552. SpecialMesh33.TextureId = "http://www.roblox.com/asset/?id=130267361"
  553. SpecialMesh33.MeshType = Enum.MeshType.FileMesh
  554. SpecialMesh33.Scale = Vector3.new(0.649999976, 0.649999976, 0.649999976)
  555. Sound34.Name = "Fire"
  556. Sound34.Parent = Part32
  557. Sound34.Pitch = 1.2000000476837
  558. Sound34.SoundId = "http://www.roblox.com/asset?id=114488148"
  559. Sound34.Volume = 1
  560. Sound35.Name = "Reload"
  561. Sound35.Parent = Part32
  562. Sound35.Pitch = 0.5
  563. Sound35.SoundId = "http://www.roblox.com/asset?id=94255248"
  564. PointLight36.Parent = Part32
  565. PointLight36.Color = Color3.new(1, 0, 0)
  566. PointLight36.Brightness = 4
  567. PointLight36.Range = 6
  568. PointLight36.Color = Color3.new(1, 0, 0)
  569. LocalScript37.Name = "ToolScript"
  570. LocalScript37.Parent = Tool31
  571. table.insert(cors,sandbox(LocalScript37,function()
  572. -----------------
  573. --| Constants |--
  574. -----------------
  575.  
  576. local SHOT_SPEED = 100
  577. local SHOT_TIME = 1000
  578.  
  579. local NOZZLE_OFFSET = Vector3.new(0, 0.4, -1.1)
  580.  
  581. -----------------
  582. --| Variables |--
  583. -----------------
  584.  
  585. local PlayersService = Game:GetService('Players')
  586. local DebrisService = Game:GetService('Debris')
  587.  
  588. local Tool = script.Parent
  589. local Handle = Tool:WaitForChild('Handle')
  590.  
  591. local FireSound = Handle:WaitForChild('Fire')
  592. local ReloadSound = Handle:WaitForChild('Reload')
  593. local HitFadeSound = script:WaitForChild('HitFade')
  594.  
  595. local PointLight = Handle:WaitForChild('PointLight')
  596.  
  597. local Character = nil
  598. local Humanoid = nil
  599. local Player = nil
  600.  
  601. local BaseShot = nil
  602.  
  603. -----------------
  604. --| Functions |--
  605. -----------------
  606.  
  607. -- Returns a character ancestor and its Humanoid, or nil
  608. local function FindCharacterAncestor(subject)
  609. if subject and subject ~= Workspace then
  610. local humanoid = subject:FindFirstChild('Humanoid')
  611. if humanoid then
  612. return subject, humanoid
  613. else
  614. return FindCharacterAncestor(subject.Parent)
  615. end
  616. end
  617. return nil
  618. end
  619.  
  620. -- Removes any old creator tags and applies new ones to the specified target
  621. local function ApplyTags(target)
  622. while target:FindFirstChild('creator') do
  623. target.creator:Destroy()
  624. end
  625.  
  626. local creatorTag = Instance.new('ObjectValue')
  627. creatorTag.Value = Player
  628. creatorTag.Name = 'creator' --NOTE: Must be called 'creator' for website stats
  629.  
  630. local iconTag = Instance.new('StringValue')
  631. iconTag.Value = Tool.TextureId
  632. iconTag.Name = 'icon'
  633.  
  634. iconTag.Parent = creatorTag
  635. creatorTag.Parent = target
  636. DebrisService:AddItem(creatorTag, 4)
  637. end
  638.  
  639. -- Returns all objects under instance with Transparency
  640. local function GetTransparentsRecursive(instance, partsTable)
  641. local partsTable = partsTable or {}
  642. for _, child in pairs(instance:GetChildren()) do
  643. if child:IsA('BasePart') or child:IsA('Decal') then
  644. table.insert(partsTable, child)
  645. end
  646. GetTransparentsRecursive(child, partsTable)
  647. end
  648. return partsTable
  649. end
  650.  
  651. local function SelectionBoxify(instance)
  652. local selectionBox = Instance.new('SelectionBox')
  653. selectionBox.Adornee = instance
  654. selectionBox.Color = BrickColor.new('Really red')
  655. selectionBox.Parent = instance
  656. return selectionBox
  657. end
  658.  
  659. local function Light(instance)
  660. local light = PointLight:Clone()
  661. light.Range = light.Range + 2
  662. light.Parent = instance
  663. end
  664.  
  665. local function FadeOutObjects(objectsWithTransparency, fadeIncrement)
  666. repeat
  667. local lastObject = nil
  668. for _, object in pairs(objectsWithTransparency) do
  669. object.Transparency = object.Transparency + fadeIncrement
  670. lastObject = object
  671. end
  672. wait()
  673. until lastObject.Transparency >= 1 or not lastObject
  674. end
  675.  
  676. local function Dematerialize(character, humanoid, firstPart)
  677. humanoid.WalkSpeed = 0
  678.  
  679. local parts = {}
  680. for _, child in pairs(character:GetChildren()) do
  681. if child:IsA('BasePart') then
  682. child.Anchored = true
  683. table.insert(parts, child)
  684. elseif child:IsA('LocalScript') or child:IsA('Script') then
  685. child:Destroy()
  686. end
  687. end
  688.  
  689. local selectionBoxes = {}
  690.  
  691. local firstSelectionBox = SelectionBoxify(firstPart)
  692. Light(firstPart)
  693. wait(0.05)
  694.  
  695. for _, part in pairs(parts) do
  696. if part ~= firstPart then
  697. table.insert(selectionBoxes, SelectionBoxify(part))
  698. Light(part)
  699. end
  700. end
  701.  
  702. local objectsWithTransparency = GetTransparentsRecursive(character)
  703. FadeOutObjects(objectsWithTransparency, 0.1)
  704.  
  705. wait(0.5)
  706.  
  707. humanoid.Health = 0
  708. DebrisService:AddItem(character, 2)
  709.  
  710. local fadeIncrement = 0.05
  711. Delay(0.2, function()
  712. FadeOutObjects({firstSelectionBox}, fadeIncrement)
  713. if character then
  714. character:Destroy()
  715. end
  716. end)
  717. FadeOutObjects(selectionBoxes, fadeIncrement)
  718. end
  719.  
  720. local function OnTouched(shot, otherPart)
  721. local character, humanoid = FindCharacterAncestor(otherPart)
  722. if character and humanoid and character ~= Character then
  723. ApplyTags(humanoid)
  724. if shot then
  725. local hitFadeSound = shot:FindFirstChild(HitFadeSound.Name)
  726. if hitFadeSound then
  727. hitFadeSound.Parent = humanoid.Torso
  728. hitFadeSound:Play()
  729. end
  730. shot:Destroy()
  731. end
  732. Dematerialize(character, humanoid, otherPart)
  733. end
  734. end
  735.  
  736. local function OnEquipped()
  737. Character = Tool.Parent
  738. Humanoid = Character:WaitForChild('Humanoid')
  739. Player = PlayersService:GetPlayerFromCharacter(Character)
  740. end
  741.  
  742. local function OnActivated()
  743. if Tool.Enabled and Humanoid.Health > 0 then
  744. Tool.Enabled = false
  745.  
  746. FireSound:Play()
  747.  
  748. local handleCFrame = Handle.CFrame
  749. local firingPoint = handleCFrame.p + handleCFrame:vectorToWorldSpace(NOZZLE_OFFSET)
  750. local shotCFrame = CFrame.new(firingPoint, Humanoid.TargetPoint)
  751.  
  752. local laserShotClone = BaseShot:Clone()
  753. laserShotClone.CFrame = shotCFrame + (shotCFrame.lookVector * (BaseShot.Size.Z / 2))
  754. local bodyVelocity = Instance.new('BodyVelocity')
  755. bodyVelocity.velocity = shotCFrame.lookVector * SHOT_SPEED
  756. bodyVelocity.Parent = laserShotClone
  757. laserShotClone.Touched:connect(function(otherPart)
  758. OnTouched(laserShotClone, otherPart)
  759. end)
  760. DebrisService:AddItem(laserShotClone, SHOT_TIME)
  761. laserShotClone.Parent = Tool
  762.  
  763. wait(0) -- FireSound length
  764.  
  765. ReloadSound:Play()
  766. wait(0) -- ReloadSound length
  767.  
  768. Tool.Enabled = true
  769. end
  770. end
  771.  
  772. local function OnUnequipped()
  773.  
  774. end
  775.  
  776. --------------------
  777. --| Script Logic |--
  778. --------------------
  779.  
  780. BaseShot = Instance.new('Part')
  781. BaseShot.Name = 'Effect'
  782. BaseShot.FormFactor = Enum.FormFactor.Custom
  783. BaseShot.Size = Vector3.new(0.2, 0.2, 3)
  784. BaseShot.CanCollide = false
  785. BaseShot.BrickColor = BrickColor.new('Really red')
  786. SelectionBoxify(BaseShot)
  787. Light(BaseShot)
  788. HitFadeSound:Clone().Parent = BaseShot
  789.  
  790. Tool.Equipped:connect(OnEquipped)
  791. Tool.Unequipped:connect(OnUnequipped)
  792. Tool.Activated:connect(OnActivated)
  793. end))
  794. Sound38.Name = "HitFade"
  795. Sound38.Parent = LocalScript37
  796. Sound38.SoundId = "http://www.roblox.com/asset?id=130113415"
  797. LocalScript39.Name = "MouseIcon"
  798. LocalScript39.Parent = Tool31
  799. table.insert(cors,sandbox(LocalScript39,function()
  800. local MOUSE_ICON = 'rbxasset://textures/GunCursor.png'
  801. local RELOADING_ICON = 'rbxasset://textures/GunWaitCursor.png'
  802.  
  803. local Tool = script.Parent
  804.  
  805. local Mouse = nil
  806.  
  807. local function UpdateIcon()
  808. if Mouse then
  809. Mouse.Icon = Tool.Enabled and MOUSE_ICON or RELOADING_ICON
  810. end
  811. end
  812.  
  813. local function OnEquipped(mouse)
  814. Mouse = mouse
  815. UpdateIcon()
  816. end
  817.  
  818. local function OnChanged(property)
  819. if property == 'Enabled' then
  820. UpdateIcon()
  821. end
  822. end
  823.  
  824. Tool.Equipped:connect(OnEquipped)
  825. Tool.Changed:connect(OnChanged)
  826.  
  827. end))
  828. Script40.Name = "Shu_hold"
  829. Script40.Parent = Tool31
  830. table.insert(cors,sandbox(Script40,function()
  831. --This script gives you a next-gen hold script better than the current one. You actually hold the barrel parallel to your face. Put it in any gun you want. Original script by Xliver101, Converted to universal script by ToastyToaster.
  832.  
  833. selected = false
  834. RSH, LSH = nil, nil
  835. GRP = nil
  836. RW, LW = Instance.new("Weld"), Instance.new("Weld")
  837. anim = "none"
  838. function WaitForChild(obj, ch_n)
  839. local t = time()
  840. while not obj:FindFirstChild(ch_n) and time() - t < 10 do wait(0.1) end
  841. return obj:FindFirstChild(ch_n)
  842. end
  843. script.Parent.Equipped:connect(function()
  844. if selected then return end
  845. selected = true
  846. player = game.Players:playerFromCharacter(script.Parent.Parent)
  847. local ch = script.Parent.Parent
  848. WaitForChild(ch, "Torso")
  849. RSH = WaitForChild(ch.Torso, "Right Shoulder")
  850. LSH = WaitForChild(ch.Torso, "Left Shoulder")
  851. GRP = WaitForChild(ch["Right Arm"], "RightGrip")
  852. _G.Grip = GRP
  853. --
  854. RSH.Part1 = nil
  855. LSH.Part1 = nil
  856. --
  857. RW.Part0 = ch.Torso
  858. RW.C0 = CFrame.new(1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.3, 0, -0.5)
  859. RW.C1 = CFrame.new(0, 0.5, 0)
  860. RW.Part1 = ch["Right Arm"]
  861. RW.Parent = ch.Torso
  862. _G.R = RW
  863. --
  864. LW.Part0 = ch.Torso
  865. LW.C0 = CFrame.new(-1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.7, 0, 0.8)
  866. LW.C1 = CFrame.new(0, 0.5, 0)
  867. LW.Part1 = ch["Left Arm"]
  868. LW.Parent = ch.Torso
  869. _G.L = LW
  870. --
  871. GRP.C0 = CFrame.new(0, -1, -0.5) * CFrame.fromEulerAnglesXYZ(-1.22, -0.45, 0.22)
  872. for i = 0, 1, 0.05 do
  873. wait()
  874. RW.C0 = CFrame.new(1.5, 0.5, 0.25) * CFrame.fromEulerAnglesXYZ(1.3*i, 0, -0.5*i)
  875. LW.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(1.7*i, 0, 0.8*i)
  876. LW.C1 = CFrame.new(0.3*i, 1+1*i, 0)
  877. end
  878. wait()
  879. local rg = (ch["Right Arm"]:FindFirstChild("RightGrip") or GRP)
  880. if rg ~= GRP then
  881. GRP.Parent = ch["Right Arm"]
  882. rg:remove()
  883. end
  884. end)
  885. script.Parent.Unequipped:connect(function()
  886. selected = false
  887. local pl = player
  888. RW.C0 = CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(0,0,0)
  889. LW.C0 = CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(0,0,0)
  890. LW.C1 = CFrame.new(0,0,0)
  891. RW.Parent = nil
  892. LW.Parent = nil
  893. RSH.Part1 = pl.Character["Right Arm"]
  894. LSH.Part1 = pl.Character["Left Arm"]
  895. end)
  896. function armReload()
  897. for i = 0, 1, 0.1 do
  898. wait()
  899. LW.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(1.3*i, 0, 0.9*i)
  900. LW.C1 = CFrame.new(0.3*i, 1+1*i, 0)
  901. end
  902. end
  903. function gunOut()
  904. for i = 0, 0.3, 0.06 do
  905. wait()
  906. GRP.C0 = CFrame.new(0+i, -1-i, 0+(2*i)) * CFrame.fromEulerAnglesXYZ(-2.22, -0.45, 0.42)
  907. LW.C0 = CFrame.new(-1, 0.5, 0) * CFrame.fromEulerAnglesXYZ(4.2, 0, 2.9)
  908. LW.C1 = CFrame.new(0.8*i, 1.1+i, -0.3)
  909. end
  910. end
  911. function gunReturn()
  912. RW.C0 = CFrame.new(1.5, 0.5, 0.25) * CFrame.fromEulerAnglesXYZ(1.3, 0, -0.5)
  913. LW.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(1.7, 0, 0.8)
  914. LW.C1 = CFrame.new(0.3, 1+1, 0)
  915. GRP.C0 = CFrame.new(0, -1, -0.5) * CFrame.fromEulerAnglesXYZ(-1.22, -0.45, 0.22)
  916. end
  917. end))
  918. Tool41.Name = "Sword"
  919. Tool41.Parent = mas
  920. Tool41.TextureId = "http://www.roblox.com/asset/?id=94746192"
  921. Tool41.GripForward = Vector3.new(1, -0, -0)
  922. Tool41.GripPos = Vector3.new(0, -1.5, 0)
  923. Tool41.GripRight = Vector3.new(0, 0, 1)
  924. Tool41.ToolTip = "Sword"
  925. Tool41.CanBeDropped = false
  926. BoolValue42.Name = "PlayOverhead"
  927. BoolValue42.Parent = Tool41
  928. BoolValue43.Name = "PlaySlash"
  929. BoolValue43.Parent = Tool41
  930. BoolValue44.Name = "PlayThrust"
  931. BoolValue44.Parent = Tool41
  932. LocalScript45.Name = "AnimationScript"
  933. LocalScript45.Parent = Tool41
  934. table.insert(cors,sandbox(LocalScript45,function()
  935. -- Waits for the child of the specified parent
  936. local function WaitForChild(parent, childName)
  937. while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
  938. return parent[childName]
  939. end
  940.  
  941. local Tool = script.Parent
  942.  
  943. local Animations = {}
  944. local MyHumanoid
  945. local MyCharacter
  946.  
  947.  
  948. local function PlayAnimation(animationName)
  949. if Animations[animationName] then
  950. Animations[animationName]:Play()
  951. end
  952. end
  953.  
  954. local function StopAnimation(animationName)
  955. if Animations[animationName] then
  956. Animations[animationName]:Stop()
  957. end
  958. end
  959.  
  960.  
  961. function OnEquipped(mouse)
  962. MyCharacter = Tool.Parent
  963. MyHumanoid = WaitForChild(MyCharacter, 'Humanoid')
  964. if MyHumanoid then
  965. Animations['EquipAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'EquipAnim5'))
  966. Animations['IdleAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'IdleAnim3'))
  967. Animations['OverheadAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'OverheadAnim2'))
  968. Animations['SlashAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'SlashAnim2'))
  969. Animations['ThrustAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'ThrustAnim2'))
  970. Animations['UnequipAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'UnequipAnim2'))
  971. end
  972. PlayAnimation('EquipAnim')
  973. PlayAnimation('IdleAnim')
  974. end
  975.  
  976. function OnUnequipped()
  977. for animName, _ in pairs(Animations) do
  978. StopAnimation(animName)
  979. end
  980. end
  981.  
  982. Tool.Equipped:connect(OnEquipped)
  983. Tool.Unequipped:connect(OnUnequipped)
  984.  
  985. WaitForChild(Tool, 'PlaySlash').Changed:connect(
  986. function (value)
  987. --if value then
  988. PlayAnimation('SlashAnim')
  989. --else
  990. -- StopAnimation('SlashAnim')
  991. --end
  992. end)
  993.  
  994. WaitForChild(Tool, 'PlayThrust').Changed:connect(
  995. function (value)
  996. --if value then
  997. PlayAnimation('ThrustAnim')
  998. --else
  999. -- StopAnimation('ThrustAnim')
  1000. --end
  1001. end)
  1002.  
  1003. WaitForChild(Tool, 'PlayOverhead').Changed:connect(
  1004. function (value)
  1005. --if value then
  1006. PlayAnimation('OverheadAnim')
  1007. --else
  1008. -- StopAnimation('OverheadAnim')
  1009. --end
  1010. end)
  1011.  
  1012. end))
  1013. LocalScript46.Name = "Local Gui"
  1014. LocalScript46.Parent = Tool41
  1015. table.insert(cors,sandbox(LocalScript46,function()
  1016. local Tool = script.Parent;
  1017.  
  1018. enabled = true
  1019. function onButton1Down(mouse)
  1020. if not enabled then
  1021. return
  1022. end
  1023.  
  1024. enabled = false
  1025. mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
  1026. while not Tool.Enabled do
  1027. wait(0.05)
  1028. end
  1029.  
  1030. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  1031. enabled = true
  1032.  
  1033. end
  1034.  
  1035. function onEquippedLocal(mouse)
  1036.  
  1037. if mouse == nil then
  1038. print("Mouse not found")
  1039. return
  1040. end
  1041.  
  1042. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  1043. mouse.Button1Down:connect(function() onButton1Down(mouse) end)
  1044. end
  1045.  
  1046.  
  1047. Tool.Equipped:connect(onEquippedLocal)
  1048.  
  1049. end))
  1050. Part47.Name = "Handle"
  1051. Part47.Parent = Tool41
  1052. Part47.BrickColor = BrickColor.new("Dark stone grey")
  1053. Part47.Reflectance = 1
  1054. Part47.Rotation = Vector3.new(0, -90, 0)
  1055. Part47.FormFactor = Enum.FormFactor.Custom
  1056. Part47.Size = Vector3.new(0.600000024, 3.60000038, 0.400000036)
  1057. Part47.CFrame = CFrame.new(23.5799007, 1.80000806, 7.10000706, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  1058. Part47.BottomSurface = Enum.SurfaceType.Smooth
  1059. Part47.TopSurface = Enum.SurfaceType.Smooth
  1060. Part47.Color = Color3.new(0.388235, 0.372549, 0.384314)
  1061. Part47.Position = Vector3.new(23.5799007, 1.80000806, 7.10000706)
  1062. Part47.Orientation = Vector3.new(0, -90, 0)
  1063. Part47.Color = Color3.new(0.388235, 0.372549, 0.384314)
  1064. SpecialMesh48.Parent = Part47
  1065. SpecialMesh48.MeshId = "http://www.roblox.com/asset/?id=94746028"
  1066. SpecialMesh48.Scale = Vector3.new(1.20000005, 1.20000005, 1.20000005)
  1067. SpecialMesh48.TextureId = "http://www.roblox.com/asset/?ID=94746105"
  1068. SpecialMesh48.MeshType = Enum.MeshType.FileMesh
  1069. SpecialMesh48.Scale = Vector3.new(1.20000005, 1.20000005, 1.20000005)
  1070. Sound49.Name = "SlashSound"
  1071. Sound49.Parent = Part47
  1072. Sound49.SoundId = "rbxasset://sounds//swordslash.wav"
  1073. Sound49.Volume = 0.34999999403954
  1074. Sound50.Name = "OverheadSound"
  1075. Sound50.Parent = Part47
  1076. Sound50.Pitch = 1.1699999570847
  1077. Sound50.SoundId = "rbxasset://sounds//swordslash.wav"
  1078. Sound51.Name = "LungeSound"
  1079. Sound51.Parent = Part47
  1080. Sound51.Pitch = 0.80000001192093
  1081. Sound51.SoundId = "rbxasset://sounds//swordlunge.wav"
  1082. Sound51.Volume = 0.25
  1083. Sound52.Name = "UnsheathSound"
  1084. Sound52.Parent = Part47
  1085. Sound52.Pitch = 1.2999999523163
  1086. Sound52.SoundId = "rbxasset://sounds//unsheath.wav"
  1087. Sound52.Volume = 0.28000000119209
  1088. Sound53.Name = "HitSound"
  1089. Sound53.Parent = Part47
  1090. Sound53.SoundId = "http://www.roblox.com/asset/?id=98220998"
  1091. Animation54.Name = "IdleAnim3"
  1092. Animation54.Parent = Tool41
  1093. Animation54.AnimationId = "http://www.roblox.com/Asset?ID=94108418"
  1094. Animation55.Name = "OverheadAnim2"
  1095. Animation55.Parent = Tool41
  1096. Animation55.AnimationId = "http://www.roblox.com/Asset?ID=94160738"
  1097. Animation56.Name = "SlashAnim2"
  1098. Animation56.Parent = Tool41
  1099. Animation56.AnimationId = "http://www.roblox.com/Asset?ID=94161088"
  1100. Animation57.Name = "ThrustAnim2"
  1101. Animation57.Parent = Tool41
  1102. Animation57.AnimationId = "http://www.roblox.com/Asset?ID=94161333"
  1103. Animation58.Name = "UnequipAnim2"
  1104. Animation58.Parent = Tool41
  1105. Animation58.AnimationId = "http://www.roblox.com/Asset?ID=94095929"
  1106. Script59.Name = "SwordScript"
  1107. Script59.Parent = Tool41
  1108. table.insert(cors,sandbox(Script59,function()
  1109. r = game:service("RunService")
  1110.  
  1111. local damage = 0
  1112.  
  1113. sword = script.Parent.Handle
  1114. Tool = script.Parent
  1115.  
  1116. local damages,values,sounds = {30,45,65},{Tool.PlaySlash,Tool.PlayThrust,Tool.PlayOverhead},{Tool.Handle.SlashSound,Tool.Handle.OverheadSound,Tool.Handle.LungeSound}
  1117. local enabledToDamage = true
  1118.  
  1119. function blow(hit)
  1120. if enabledToDamage == false then return end
  1121. enabledToDamage = false
  1122. if (hit.Parent == nil) then enabledToDamage = true return end -- happens when bullet hits sword
  1123. local humanoid = hit.Parent:findFirstChild("Humanoid")
  1124. local vCharacter = Tool.Parent
  1125. local vPlayer = game.Players:playerFromCharacter(vCharacter)
  1126. local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
  1127. if humanoid~=nil and humanoid ~= hum and hum ~= nil then
  1128. -- final check, make sure sword is in-hand
  1129. local right_arm = vCharacter:FindFirstChild("Right Arm")
  1130. if (right_arm ~= nil) then
  1131. local joint = right_arm:FindFirstChild("RightGrip")
  1132. if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
  1133. tagHumanoid(humanoid, vPlayer)
  1134. humanoid:TakeDamage(damage)
  1135. wait(1)
  1136. untagHumanoid(humanoid)
  1137. else
  1138. enabledToDamage = true
  1139. end
  1140. else
  1141. enabledToDamage = true
  1142. end
  1143. else
  1144. enabledToDamage = true
  1145. end
  1146. end
  1147.  
  1148.  
  1149. function tagHumanoid(humanoid, player)
  1150. local creator_tag = Instance.new("ObjectValue")
  1151. creator_tag.Value = player
  1152. creator_tag.Name = "creator"
  1153. creator_tag.Parent = humanoid
  1154. end
  1155.  
  1156. function untagHumanoid(humanoid)
  1157. if humanoid ~= nil then
  1158. local tag = humanoid:findFirstChild("creator")
  1159. if tag ~= nil then
  1160. tag.Parent = nil
  1161. end
  1162. end
  1163. end
  1164.  
  1165.  
  1166. function attack()
  1167. damage = slash_damage
  1168. script.Parent.Handle.SlashSound:Play()
  1169. script.Parent.PlaySlash.Value = not script.Parent.PlaySlash.Value
  1170. end
  1171.  
  1172. function lunge()
  1173. damage = lunge_damage
  1174. script.Parent.Handle.LungeSound:Play()
  1175. script.Parent.PlayOverhead.Value = not script.Parent.PlayOverhead.Value
  1176. force = Instance.new("BodyVelocity")
  1177. force.velocity = Vector3.new(0,10,0) --Tool.Parent.Torso.CFrame.lookVector * 80
  1178. force.Parent = Tool.Parent.Torso
  1179. wait(.5)
  1180. force.Parent = nil
  1181. wait(.5)
  1182. damage = slash_damage
  1183. end
  1184.  
  1185.  
  1186. Tool.Enabled = true
  1187. local last_attack = 0
  1188. local status = 0
  1189.  
  1190. function onActivated()
  1191. if not Tool.Enabled then
  1192. return
  1193. end
  1194. Tool.Enabled = false
  1195. local character = Tool.Parent;
  1196. local humanoid = character.Humanoid
  1197. if humanoid == nil then
  1198. print("Humanoid not found")
  1199. return
  1200. end
  1201. t = r.Stepped:wait()
  1202. if (t - last_attack < 1.5) then
  1203. if status == 3 then
  1204. status = 0
  1205. damage = 0
  1206. else
  1207. status = status + 1
  1208. values[status].Value = not values[status].Value
  1209. damage = damages[status]
  1210. sounds[status]:Play()
  1211. enabledToDamage = true
  1212. wait(0.5)
  1213. enabledToDamage = false
  1214. end
  1215. else
  1216. status = 0
  1217. damage = 0
  1218. end
  1219. last_attack = t
  1220. Tool.Enabled = true
  1221. end
  1222.  
  1223. function onEquipped()
  1224. wait(1/3)
  1225. Tool.Handle.UnsheathSound:Play()
  1226. end
  1227.  
  1228. Tool.Equipped:connect(onEquipped)
  1229. script.Parent.Activated:connect(onActivated)
  1230. connection = sword.Touched:connect(blow)
  1231. end))
  1232. Animation60.Name = "EquipAnim5"
  1233. Animation60.Parent = Tool41
  1234. Animation60.AnimationId = "http://www.roblox.com/Asset?ID=94160581"
  1235. for i,v in pairs(mas:GetChildren()) do
  1236. v.Parent = game:GetService("Players").LocalPlayer.Backpack
  1237. pcall(function() v:MakeJoints() end)
  1238. end
  1239. mas:Destroy()
  1240. for i,v in pairs(cors) do
  1241. spawn(function()
  1242. pcall(v)
  1243. end)
  1244. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement