Advertisement
Kaemi

saiyan killer 9000

Mar 1st, 2018
551
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.57 KB | None | 0 0
  1. --Dis sword can counter from goku spammers ENJOY!
  2. function sandbox(var,func)
  3. local env = getfenv(func)
  4. local newenv = setmetatable({},{
  5. __index = function(self,k)
  6. if k=="script" then
  7. return var
  8. else
  9. return env[k]
  10. end
  11. end,
  12. })
  13. setfenv(func,newenv)
  14. return func
  15. end
  16. cors = {}
  17. mas = Instance.new("Model",game:GetService("Lighting"))
  18. Tool0 = Instance.new("Tool")
  19. BoolValue1 = Instance.new("BoolValue")
  20. BoolValue2 = Instance.new("BoolValue")
  21. BoolValue3 = Instance.new("BoolValue")
  22. Part4 = Instance.new("Part")
  23. SpecialMesh5 = Instance.new("SpecialMesh")
  24. Sound6 = Instance.new("Sound")
  25. Sound7 = Instance.new("Sound")
  26. Sound8 = Instance.new("Sound")
  27. Sound9 = Instance.new("Sound")
  28. Sound10 = Instance.new("Sound")
  29. Sound11 = Instance.new("Sound")
  30. Script12 = Instance.new("Script")
  31. Script13 = Instance.new("Script")
  32. LocalScript14 = Instance.new("LocalScript")
  33. LocalScript15 = Instance.new("LocalScript")
  34. Script16 = Instance.new("Script")
  35. Animation17 = Instance.new("Animation")
  36. Animation18 = Instance.new("Animation")
  37. Animation19 = Instance.new("Animation")
  38. Animation20 = Instance.new("Animation")
  39. Animation21 = Instance.new("Animation")
  40. Animation22 = Instance.new("Animation")
  41. Tool0.Name = "Sword"
  42. Tool0.Parent = mas
  43. Tool0.TextureId = "http://www.roblox.com/asset/?id=120894242"
  44. Tool0.GripPos = Vector3.new(0, -2.79999995, 0)
  45. Tool0.ToolTip = "Mixamo"
  46. BoolValue1.Name = "PlayOverhead"
  47. BoolValue1.Parent = Tool0
  48. BoolValue1.Value = true
  49. BoolValue2.Name = "PlaySlash"
  50. BoolValue2.Parent = Tool0
  51. BoolValue2.Value = true
  52. BoolValue3.Name = "PlayThrust"
  53. BoolValue3.Parent = Tool0
  54. Part4.Name = "Handle"
  55. Part4.Parent = Tool0
  56. Part4.BrickColor = BrickColor.new("Really black")
  57. Part4.Reflectance = 1
  58. Part4.Rotation = Vector3.new(-115.290001, 58.3499985, 104.279999)
  59. Part4.FormFactor = Enum.FormFactor.Custom
  60. Part4.Size = Vector3.new(1, 5.99999857, 1)
  61. Part4.CFrame = CFrame.new(15.5499144, 20.4776459, 29.7129097, -0.129414797, -0.508500516, 0.851280689, -0.224160001, 0.85127914, 0.474421859, -0.965921283, -0.129425809, -0.224153638)
  62. Part4.BottomSurface = Enum.SurfaceType.Smooth
  63. Part4.TopSurface = Enum.SurfaceType.Smooth
  64. Part4.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  65. Part4.Position = Vector3.new(15.5499144, 20.4776459, 29.7129097)
  66. Part4.Orientation = Vector3.new(-28.3199997, 104.75, -14.75)
  67. Part4.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  68. SpecialMesh5.Parent = Part4
  69. SpecialMesh5.MeshId = "rbxassetid://497301002"
  70. SpecialMesh5.Scale = Vector3.new(1.20000005, 1.20000005, 1.20000005)
  71. SpecialMesh5.TextureId = "rbxassetid://497301004"
  72. SpecialMesh5.MeshType = Enum.MeshType.FileMesh
  73. SpecialMesh5.Scale = Vector3.new(1.20000005, 1.20000005, 1.20000005)
  74. Sound6.Name = "HitSound"
  75. Sound6.Parent = Part4
  76. Sound6.Pitch = 0.80000001192093
  77. Sound6.SoundId = "http://www.roblox.com/Asset?ID=96667969"
  78. Sound6.Volume = 0.75
  79. Sound7.Name = "LungeSound"
  80. Sound7.Parent = Part4
  81. Sound7.Pitch = 0.80000001192093
  82. Sound7.SoundId = "rbxasset://sounds//swordlunge.wav"
  83. Sound7.Volume = 0.25
  84. Sound8.Name = "OverheadSound"
  85. Sound8.Parent = Part4
  86. Sound8.Pitch = 0.94999998807907
  87. Sound8.SoundId = "rbxasset://sounds//swordslash.wav"
  88. Sound9.Name = "SlashSound"
  89. Sound9.Parent = Part4
  90. Sound9.Pitch = 0.80000001192093
  91. Sound9.SoundId = "rbxasset://sounds//swordslash.wav"
  92. Sound9.Volume = 0.34999999403954
  93. Sound10.Name = "UnsheathSound"
  94. Sound10.Parent = Part4
  95. Sound10.SoundId = "http://www.roblox.com/asset/?id=134747889"
  96. Sound10.Volume = 0.75
  97. Sound11.Name = "Kaboom!"
  98. Sound11.Parent = Part4
  99. Sound11.SoundId = "rbxassetid://138084923"
  100. Script12.Name = "MoveScriptToPlayer"
  101. Script12.Parent = Part4
  102. table.insert(cors,sandbox(Script12,function()
  103. function onTouched(part)
  104. if part.Parent ~= nil then
  105. local humanoid = part.Parent:findFirstChild("Humanoid") or part.Parent:findFirstChild("haha nope") or part.Parent:findFirstChild("LolCantHurtMe")
  106. if humanoid and debounce==nil then
  107. debounce = true
  108. --script.Parent.Parent = nil
  109. humanoid.Parent:BreakJoints()
  110. script.Parent["Kaboom!"]:Play()
  111. explosion = Instance.new("Explosion")
  112. explosion.BlastRadius = 3
  113. explosion.BlastPressure = 0
  114. explosion.Position = part.Position
  115. explosion.Parent = game.Workspace
  116. wait(1)
  117. debounce = nil
  118. end
  119. end
  120. end
  121. script.Parent.Touched:connect(onTouched)
  122. end))
  123. Script13.Name = "SwordSwing"
  124. Script13.Parent = Tool0
  125. table.insert(cors,sandbox(Script13,function()
  126. r = game:service("RunService")
  127.  
  128. local damage = 0
  129.  
  130. sword = script.Parent.Handle
  131. Tool = script.Parent
  132.  
  133. local damages,values,sounds = {35,50,75},{Tool.PlaySlash,Tool.PlayThrust,Tool.PlayOverhead},{Tool.Handle.SlashSound,Tool.Handle.OverheadSound,Tool.Handle.LungeSound}
  134. local enabledToDamage = true
  135.  
  136. function blow(hit)
  137. if enabledToDamage == false then return end
  138. enabledToDamage = false
  139. if (hit.Parent == nil) then enabledToDamage = true return end -- happens when bullet hits sword
  140. local humanoid = hit.Parent:findFirstChild("Humanoid")
  141. local vCharacter = Tool.Parent
  142. local vPlayer = game.Players:playerFromCharacter(vCharacter)
  143. local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
  144. if humanoid~=nil and humanoid ~= hum and hum ~= nil then
  145. -- final check, make sure sword is in-hand
  146. local right_arm = vCharacter:FindFirstChild("Right Arm")
  147. if (right_arm ~= nil) then
  148. local joint = right_arm:FindFirstChild("RightGrip")
  149. if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
  150. tagHumanoid(humanoid, vPlayer)
  151. humanoid:TakeDamage(damage)
  152. wait(1)
  153. untagHumanoid(humanoid)
  154. else
  155. enabledToDamage = true
  156. end
  157. else
  158. enabledToDamage = true
  159. end
  160. else
  161. enabledToDamage = true
  162. end
  163. end
  164.  
  165.  
  166. function tagHumanoid(humanoid, player)
  167. local creator_tag = Instance.new("ObjectValue")
  168. creator_tag.Value = player
  169. creator_tag.Name = "creator"
  170. creator_tag.Parent = humanoid
  171. end
  172.  
  173. function untagHumanoid(humanoid)
  174. if humanoid ~= nil then
  175. local tag = humanoid:findFirstChild("creator")
  176. if tag ~= nil then
  177. tag.Parent = nil
  178. end
  179. end
  180. end
  181.  
  182.  
  183. function attack()
  184. damage = slash_damage
  185. script.Parent.Handle.SlashSound:Play()
  186. script.Parent.PlaySlash.Value = not script.Parent.PlaySlash.Value
  187. end
  188.  
  189. function lunge()
  190. damage = lunge_damage
  191. script.Parent.Handle.LungeSound:Play()
  192. script.Parent.PlayOverhead.Value = not script.Parent.PlayOverhead.Value
  193. force = Instance.new("BodyVelocity")
  194. force.velocity = Vector3.new(0,10,0) --Tool.Parent.Torso.CFrame.lookVector * 80
  195. force.Parent = Tool.Parent.Torso
  196. wait(.5)
  197. force.Parent = nil
  198. wait(.5)
  199. damage = slash_damage
  200. end
  201.  
  202.  
  203. Tool.Enabled = true
  204. local last_attack = 0
  205. local status = 0
  206.  
  207. function onActivated()
  208. if not Tool.Enabled then
  209. return
  210. end
  211. Tool.Enabled = false
  212. local character = Tool.Parent;
  213. local humanoid = character.Humanoid
  214. if humanoid == nil then
  215. print("Humanoid not found")
  216. return
  217. end
  218. t = r.Stepped:wait()
  219. if (t - last_attack < 1.5) then
  220. if status == 3 then
  221. status = 0
  222. damage = 0
  223. else
  224. status = status + 1
  225. values[status].Value = not values[status].Value
  226. damage = damages[status]
  227. sounds[status]:Play()
  228. enabledToDamage = true
  229. wait(0.5)
  230. enabledToDamage = false
  231. end
  232. else
  233. status = 0
  234. damage = 0
  235. end
  236. last_attack = t
  237. Tool.Enabled = true
  238. end
  239.  
  240. function onEquipped()
  241. wait(1/3)
  242. Tool.Handle.UnsheathSound:Play()
  243. end
  244.  
  245. Tool.Equipped:connect(onEquipped)
  246. script.Parent.Activated:connect(onActivated)
  247. connection = sword.Touched:connect(blow)
  248. end))
  249. LocalScript14.Name = "AnimationScript"
  250. LocalScript14.Parent = Tool0
  251. table.insert(cors,sandbox(LocalScript14,function()
  252. -- Waits for the child of the specified parent
  253. local function WaitForChild(parent, childName)
  254. while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
  255. return parent[childName]
  256. end
  257.  
  258. local Tool = script.Parent
  259.  
  260. local Animations = {}
  261. local MyHumanoid
  262. local MyCharacter
  263.  
  264.  
  265. local function PlayAnimation(animationName)
  266. if Animations[animationName] then
  267. Animations[animationName]:Play()
  268. end
  269. end
  270.  
  271. local function StopAnimation(animationName)
  272. if Animations[animationName] then
  273. Animations[animationName]:Stop()
  274. end
  275. end
  276.  
  277.  
  278. function OnEquipped(mouse)
  279. MyCharacter = Tool.Parent
  280. MyHumanoid = WaitForChild(MyCharacter, 'Humanoid')
  281. if MyHumanoid then
  282. Animations['EquipAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'EquipAnim5'))
  283. Animations['IdleAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'IdleAnim3'))
  284. Animations['OverheadAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'OverheadAnim2'))
  285. Animations['SlashAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'SlashAnim2'))
  286. Animations['ThrustAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'ThrustAnim2'))
  287. Animations['UnequipAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'UnequipAnim2'))
  288. end
  289. PlayAnimation('EquipAnim')
  290. PlayAnimation('IdleAnim')
  291. end
  292.  
  293. function OnUnequipped()
  294. for animName, _ in pairs(Animations) do
  295. StopAnimation(animName)
  296. end
  297. end
  298.  
  299. Tool.Equipped:connect(OnEquipped)
  300. Tool.Unequipped:connect(OnUnequipped)
  301.  
  302. WaitForChild(Tool, 'PlaySlash').Changed:connect(
  303. function (value)
  304. --if value then
  305. PlayAnimation('SlashAnim')
  306. --else
  307. -- StopAnimation('SlashAnim')
  308. --end
  309. end)
  310.  
  311. WaitForChild(Tool, 'PlayThrust').Changed:connect(
  312. function (value)
  313. --if value then
  314. PlayAnimation('ThrustAnim')
  315. --else
  316. -- StopAnimation('ThrustAnim')
  317. --end
  318. end)
  319.  
  320. WaitForChild(Tool, 'PlayOverhead').Changed:connect(
  321. function (value)
  322. --if value then
  323. PlayAnimation('OverheadAnim')
  324. --else
  325. -- StopAnimation('OverheadAnim')
  326. --end
  327. end)
  328.  
  329. end))
  330. LocalScript15.Name = "Local Gui"
  331. LocalScript15.Parent = Tool0
  332. table.insert(cors,sandbox(LocalScript15,function()
  333. local Tool = script.Parent;
  334.  
  335. enabled = true
  336. function onButton1Down(mouse)
  337. if not enabled then
  338. return
  339. end
  340.  
  341. enabled = false
  342. mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
  343. while not Tool.Enabled do
  344. wait(0.05)
  345. end
  346.  
  347. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  348. enabled = true
  349.  
  350. end
  351.  
  352. function onEquippedLocal(mouse)
  353.  
  354. if mouse == nil then
  355. print("Mouse not found")
  356. return
  357. end
  358.  
  359. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  360. mouse.Button1Down:connect(function() onButton1Down(mouse) end)
  361. end
  362.  
  363.  
  364. Tool.Equipped:connect(onEquippedLocal)
  365.  
  366. end))
  367. Script16.Name = "SwordScript"
  368. Script16.Parent = Tool0
  369. table.insert(cors,sandbox(Script16,function()
  370. -- Copied from Grimgold Periastron Beta
  371.  
  372. local Tool = script.Parent
  373. local Sword = Tool.Handle
  374.  
  375. local vCharacter
  376. local myTorso
  377. local myHumanoid
  378.  
  379. local equipped = false
  380.  
  381. local debris = game:GetService("Debris")
  382.  
  383. function tagHumanoid(humanoid, player)
  384. if humanoid then
  385. local creatorTag = Instance.new("ObjectValue")
  386. creatorTag.Value = player
  387. creatorTag.Name = "creator"
  388. creatorTag.Parent = humanoid
  389. debris:AddItem(creatorTag, 1)
  390. end
  391. end
  392.  
  393. function cut(hit)
  394. local humanoid
  395. local vPlayer
  396. if hit and hit.Parent and myHumanoid then
  397. if hit.Parent.className == "Hat" then
  398. humanoid = hit.Parent.Parent:FindFirstChild("Humanoid") or hit.Parent:findFirstChild("haha nope") or hit.Parent:findFirstChild("LolCantHurtMe")
  399. else
  400. humanoid = hit.Parent:FindFirstChild("Humanoid")
  401. end
  402. vPlayer = game.Players:GetPlayerFromCharacter(vCharacter)
  403. if humanoid ~= nil and humanoid ~= myHumanoid then
  404. tagHumanoid(humanoid, vPlayer)
  405. humanoid:TakeDamage(7.5)
  406. end
  407. end
  408. end
  409.  
  410. function onEquipped()
  411. vCharacter = Tool.Parent
  412. myTorso = vCharacter:FindFirstChild("Torso")
  413. myHumanoid = vCharacter:FindFirstChild("Humanoid")
  414. end
  415.  
  416. Tool.Equipped:connect(onEquipped)
  417.  
  418. Sword.Touched:connect(cut)
  419. end))
  420. Animation17.Name = "EquipAnim5"
  421. Animation17.Parent = Tool0
  422. Animation17.AnimationId = "http://www.roblox.com/Asset?ID=94160581"
  423. Animation18.Name = "IdleAnim3"
  424. Animation18.Parent = Tool0
  425. Animation18.AnimationId = "http://www.roblox.com/Asset?ID=94108418"
  426. Animation19.Name = "OverheadAnim2"
  427. Animation19.Parent = Tool0
  428. Animation19.AnimationId = "http://www.roblox.com/Asset?ID=94160738"
  429. Animation20.Name = "SlashAnim2"
  430. Animation20.Parent = Tool0
  431. Animation20.AnimationId = "http://www.roblox.com/Asset?ID=94161088"
  432. Animation21.Name = "ThrustAnim2"
  433. Animation21.Parent = Tool0
  434. Animation21.AnimationId = "http://www.roblox.com/Asset?ID=94161333"
  435. Animation22.Name = "UnequipAnim2"
  436. Animation22.Parent = Tool0
  437. Animation22.AnimationId = "http://www.roblox.com/Asset?ID=94095929"
  438. for i,v in pairs(mas:GetChildren()) do
  439. v.Parent = game:GetService("Players").LocalPlayer.Backpack
  440. pcall(function() v:MakeJoints() end)
  441. end
  442. mas:Destroy()
  443. for i,v in pairs(cors) do
  444. spawn(function()
  445. pcall(v)
  446. end)
  447. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement