1x11337

Sword

Jul 7th, 2018
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --Enjoy this shit
  2. --When you Click its explode asf
  3. --Touch kids with the sword to kill them.
  4. --Made by N3xul
  5. local runDummyScript = function(f,scri)
  6. local oldenv = getfenv(f)
  7. local newenv = setmetatable({}, {
  8. __index = function(_, k)
  9. if k:lower() == 'script' then
  10. return scri
  11. else
  12. return oldenv[k]
  13. end
  14. end
  15. })
  16. setfenv(f, newenv)
  17. ypcall(function() f() end)
  18. end
  19. cors = {}
  20. mas = Instance.new("Model",game:GetService("Lighting"))
  21. mas.Name = "CompiledModel"
  22. o1 = Instance.new("HopperBin")
  23. o2 = Instance.new("LocalScript")
  24. o1.Name = "OPSwords"
  25. o1.Parent = mas
  26. o1.TextureId = "http://www.roblox.com/asset/?id=23722071"
  27. o2.Name = "AnimDeath"
  28. o2.Parent = o1
  29. table.insert(cors,coroutine.create(function()
  30. wait()
  31. runDummyScript(function()
  32. print("Animator Loaded.");
  33.  
  34. --Animation Manager--
  35. local bin = script.Parent;
  36. while (game.Players.LocalPlayer.Character == nil) do
  37. wait()
  38. end
  39. print("Player found. :)");
  40. local player = game.Players.LocalPlayer.Character;
  41. local human = player.Humanoid;
  42.  
  43. --Tool Variables--
  44. local tselected = false;
  45.  
  46. --Base Part--
  47. local block = Instance.new("Part");
  48. block.FormFactor = "Symmetric";
  49. block.Size = Vector3.new(1, 1, 1);
  50. block.Transparency = 1;
  51. block.CanCollide = false;
  52. block.Locked = true;
  53.  
  54. local sword = Instance.new("Part");
  55. sword.FormFactor = "Plate";
  56. sword.Shape = "Block";
  57. sword.Size = Vector3.new(1, 0.8, 4);
  58. sword.Transparency = 1;
  59. sword.CanCollide = false;
  60. local SlashSound = Instance.new("Sound")
  61. SlashSound.SoundId = "http://www.roblox.com/asset/?id=11998777"
  62. SlashSound.Pitch = 1.4;
  63. SlashSound.Looped = true;
  64. SlashSound.Name = "Voom";
  65. SlashSound.Parent = sword
  66. snd = Instance.new("Sound")
  67. snd.SoundId = "http://www.roblox.com/asset/?id=2233908"
  68. snd.Volume = 1
  69. snd.Name = "Boom"
  70. snd.Parent = sword
  71. local UnsheathSound = Instance.new("Sound")
  72. UnsheathSound.SoundId = "http://www.roblox.com/asset/?id=11998770"
  73. UnsheathSound.Name = "Go"
  74. UnsheathSound.Volume = 0.5
  75. UnsheathSound.Parent = sword
  76. local mesh = Instance.new("SpecialMesh");
  77. mesh.MeshType = "FileMesh";
  78. mesh.MeshId = "http://www.roblox.com/asset/?id=11996935";
  79. mesh.Scale = Vector3.new(1.4,1.4,1.4);
  80. mesh.TextureId = "http://www.roblox.com/asset/?id=23719291";
  81. mesh.Parent = sword;
  82. local sparkle = Instance.new("Sparkles")
  83. sparkle.SparkleColor = Color3.new(0, 255, 155);
  84. sparkle.Parent = sword;
  85. sparkle.Enabled = false;
  86. local sword2 = sword:Clone();
  87.  
  88. local lsweld = Instance.new("Weld");
  89. local rsweld = Instance.new("Weld");
  90. --Left Arm Positioners and Welders--
  91. local lPosBase = block:Clone();
  92. local lPosWeld = Instance.new("Weld");
  93. local lRotBase = block:Clone();
  94. local lRotWeld = Instance.new("Weld");
  95. local lArmWeld = Instance.new("Weld");
  96.  
  97. --Right Arm Positioners and Welders--
  98. local rPosBase = block:Clone();
  99. local rPosWeld = Instance.new("Weld");
  100. local rRotBase = block:Clone();
  101. local rRotWeld = Instance.new("Weld");
  102. local rArmWeld = Instance.new("Weld");
  103.  
  104. --Head Welder--
  105. local hRotBase = block:Clone();
  106. local hRotWeld = Instance.new("Weld");
  107. local headWeld = Instance.new("Weld");
  108.  
  109. --Bind the base parts to the Torso. Tricky.
  110.  
  111. --Left--
  112. lPosBase.Name = "LPosBase";
  113. lPosWeld.Name = "LPosWeld";
  114. lRotBase.Name = "LRotBase";
  115. lRotWeld.Name = "LRotWeld";
  116. lPosWeld.Part0 = player.Torso;
  117. lPosWeld.Part1 = lPosBase;
  118. lPosWeld.C1 = CFrame.new(1.5, -0.5, 0);
  119. lPosWeld.Parent = player.Torso;
  120. lPosBase.Parent = player;
  121. lRotWeld.Part0 = lPosBase;
  122. lRotWeld.Part1 = lRotBase;
  123. lRotWeld.Parent = player.Torso;
  124. lRotBase.Parent = player;
  125. lArmWeld.Part0 = lRotBase;
  126. lArmWeld.C1 = CFrame.new(0, 0.5, 0);
  127. lArmWeld.Parent = player.Torso;
  128.  
  129. --Right--
  130. rPosBase.Name = "RPosBase";
  131. rPosWeld.Name = "RPosWeld";
  132. rRotBase.Name = "RRotBase";
  133. rRotWeld.Name = "RRotWeld";
  134. rPosWeld.Part0 = player.Torso;
  135. rPosWeld.Part1 = rPosBase;
  136. rPosWeld.C1 = CFrame.new(-1.5, -0.5, 0);
  137. rPosWeld.Parent = player.Torso;
  138. rPosBase.Parent = player;
  139. rRotWeld.Part0 = rPosBase;
  140. rRotWeld.Part1 = rRotBase;
  141. rRotWeld.Parent = player.Torso;
  142. rRotBase.Parent = player;
  143. rArmWeld.Part0 = rRotBase;
  144. rArmWeld.C1 = CFrame.new(0, 0.5, 0);
  145. rArmWeld.Parent = player.Torso;
  146.  
  147. --Head--
  148. hRotBase.Name = "HRotBase";
  149. hRotWeld.Name = "HRotWeld";
  150. headWeld.Name = "HeadWeld";
  151. hRotWeld.Part0 = player.Torso;
  152. hRotWeld.Part1 = hRotBase;
  153. hRotWeld.C1 = CFrame.new(0, -1.5, 0);
  154. hRotWeld.Parent = player.Torso;
  155. hRotBase.Parent = player;
  156. headWeld.Part0 = hRotBase;
  157. headWeld.Parent = player.Torso;
  158.  
  159. --Le Swords--
  160. lsweld.Part0 = lRotBase;
  161. rsweld.Part0 = rRotBase;
  162. lsweld.Part1 = sword;
  163. rsweld.Part1 = sword2;
  164. lsweld.C1 = CFrame.new(0, 0, -3.5)*CFrame.Angles(math.rad(270), math.rad(90), 0);
  165. rsweld.C1 = CFrame.new(0, 0, -3.5)*CFrame.Angles(math.rad(270), math.rad(90), 0);
  166. lsweld.Parent = player.Torso;
  167. rsweld.Parent = player.Torso;
  168. sword.Parent = player;
  169. sword2.Parent = player;
  170. sword.Voom:Stop();
  171. sword2.Voom:Stop();
  172. print("Bases binded.");
  173.  
  174. --Binds the arms and head to the base parts.
  175. function bind()
  176. lArmWeld.Part1 = player:FindFirstChild("Left Arm");
  177. rArmWeld.Part1 = player:FindFirstChild("Right Arm");
  178. headWeld.Part1 = player:FindFirstChild("Head");
  179. sword.Transparency = 0;
  180. sword2.Transparency = 0;
  181. sword.Go:Play();
  182. sword2.Go:Play();
  183. sword.Sparkles.Enabled = true;
  184. sword2.Sparkles.Enabled = true;
  185. human.WalkSpeed = 28;
  186. sword.Voom:Play();
  187. sword2.Voom:Play();
  188. end
  189.  
  190. --Releases the arms and head from the base parts.
  191. function unbind()
  192. lArmWeld.Part1 = nil;
  193. rArmWeld.Part1 = nil;
  194. headWeld.Part1 = nil;
  195. sword.Transparency = 1;
  196. sword2.Transparency = 1;
  197. sword.Sparkles.Enabled = false;
  198. sword2.Sparkles.Enabled = false;
  199. human.WalkSpeed = 28;
  200. sword.Go:Play();
  201. sword2.Go:Play();
  202. sword.Voom:Stop();
  203. sword2.Voom:Stop();
  204. end
  205.  
  206. function boom(part)
  207. wait();
  208. if part == nil or tselected == false then return end;
  209. if part.Anchored then return end;
  210. if part.Parent == player or part.Parent.Parent == player then return end;
  211. human:TakeDamage(-1);
  212. sword.Sparkles:Clone().Parent = part;
  213. sword.Go:Play();
  214. sword2.Go:Play();
  215. wait(0.5)
  216. part:BreakJoints();
  217. part.Velocity = Vector3.new(part.Velocity.X+ math.random(10, 20), part.Velocity.Y + math.random(100, 200), part.Velocity.Z+ math.random(10, 20));
  218. game.Debris:AddItem(part, 10);
  219. end
  220.  
  221. local load = true;
  222.  
  223. function selected(mouse)
  224. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  225. bind();
  226. human.MaxHealth = 9999999;
  227. if player:FindFirstChild("ForceField") then
  228. player.ForceField:Destroy();
  229. end
  230. tselected = true;
  231. mouse.Button1Down:connect(function()
  232. if (load) then
  233. mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
  234. load = false
  235. sword.Boom:Play();
  236. sword2.Boom:Play();
  237. local e = Instance.new("Explosion");
  238. e.Hit:connect(boom);
  239. e.Position = player.Torso.Position;
  240. e.BlastPressure = 0;
  241. e.BlastRadius = 1000;
  242. e.Parent = game.Workspace;
  243. human:TakeDamage(50);
  244. wait(1)
  245. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  246. load = true
  247. end
  248. end)
  249. while tselected do
  250. lRotWeld.C1 = CFrame.Angles(math.rad(math.random(0, 360)), math.rad(math.random(0, 360)), math.rad(math.random(0, 360)));
  251. rRotWeld.C1 = CFrame.Angles(math.rad(math.random(0, 360)), math.rad(math.random(0, 360)), math.rad(math.random(0, 360)));
  252. human:TakeDamage(-0.25);
  253. wait();
  254. end
  255. end
  256.  
  257. function deselected()
  258. tselected = false;
  259. unbind();
  260. human.MaxHealth = 9999999;
  261. end
  262.  
  263. --Event Listeners--
  264. sword.Touched:connect(boom);
  265. sword2.Touched:connect(boom);
  266. human.Jumping:connect(function()if tselected == false then return end player.Torso.Velocity = Vector3.new(player.Torso.Velocity.X, player.Torso.Velocity.Y + 40, player.Torso.Velocity.Z)end);
  267. --Tool--
  268. bin.Selected:connect(selected);
  269. bin.Deselected:connect(deselected);
  270. end,o2)
  271. end))
  272. mas.Parent = workspace
  273. mas:MakeJoints()
  274. local mas1 = mas:GetChildren()
  275. for i=1,#mas1 do
  276. mas1[i].Parent = game:GetService("Players").LocalPlayer.Backpack
  277. ypcall(function() mas1[i]:MakeJoints() end)
  278. end
  279. mas:Destroy()
  280. for i=1,#cors do
  281. coroutine.resume(cors[i])
  282. end
Add Comment
Please, Sign In to add comment