TRAx0lv

Untitled

Nov 16th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.75 KB | None | 0 0
  1. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  2. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  3. do
  4. print("FE Compatibility code by Mokiros")
  5. script.Parent = Player.Character
  6.  
  7. --RemoteEvent for communicating
  8. local Event = Instance.new("RemoteEvent")
  9. Event.Name = "UserInput_Event"
  10.  
  11. --Fake event to make stuff like Mouse.KeyDown work
  12. local function fakeEvent()
  13. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  14. t.connect = t.Connect
  15. return t
  16. end
  17.  
  18. --Creating fake input objects with fake variables
  19. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  20. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  21. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  22. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  23. end}
  24. --Merged 2 functions into one by checking amount of arguments
  25. CAS.UnbindAction = CAS.BindAction
  26.  
  27. --This function will trigger the events that have been :Connect()'ed
  28. local function te(self,ev,...)
  29. local t = m[ev]
  30. if t and t._fakeEvent and t.Function then
  31. t.Function(...)
  32. end
  33. end
  34. m.TrigEvent = te
  35. UIS.TrigEvent = te
  36.  
  37. Event.OnServerEvent:Connect(function(plr,io)
  38. if plr~=Player then return end
  39. if io.isMouse then
  40. m.Target = io.Target
  41. m.Hit = io.Hit
  42. else
  43. local b = io.UserInputState == Enum.UserInputState.Begin
  44. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  45. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  46. end
  47. for _,t in pairs(CAS.Actions) do
  48. for _,k in pairs(t.Keys) do
  49. if k==io.KeyCode then
  50. t.Function(t.Name,io.UserInputState,io)
  51. end
  52. end
  53. end
  54. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  55. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  56. end
  57. end)
  58. Event.Parent = NLS([==[
  59. local Player = game:GetService("Players").LocalPlayer
  60. local Event = script:WaitForChild("UserInput_Event")
  61.  
  62. local UIS = game:GetService("UserInputService")
  63. local input = function(io,a)
  64. if a then return end
  65. --Since InputObject is a client-side instance, we create and pass table instead
  66. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  67. end
  68. UIS.InputBegan:Connect(input)
  69. UIS.InputEnded:Connect(input)
  70.  
  71. local Mouse = Player:GetMouse()
  72. local h,t
  73. --Give the server mouse data 30 times every second, but only if the values changed
  74. --If player is not moving their mouse, client won't fire events
  75. while wait(1/30) do
  76. if h~=Mouse.Hit or t~=Mouse.Target then
  77. h,t=Mouse.Hit,Mouse.Target
  78. Event:FireServer({isMouse=true,Target=t,Hit=h})
  79. end
  80. end]==],Player.Character)
  81. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  82. end
  83.  
  84. --Enjoy this shit
  85. --When you Click its explode asf
  86. --Touch kids with the sword to kill them.
  87. --Made by N3xul
  88. local runDummyScript = function(f,scri)
  89. local oldenv = getfenv(f)
  90. local newenv = setmetatable({}, {
  91. __index = function(_, k)
  92. if k:lower() == 'script' then
  93. return scri
  94. else
  95. return oldenv[k]
  96. end
  97. end
  98. })
  99. setfenv(f, newenv)
  100. ypcall(function() f() end)
  101. end
  102. cors = {}
  103. mas = Instance.new("Model",game:GetService("Lighting"))
  104. mas.Name = "CompiledModel"
  105. o1 = Instance.new("HopperBin")
  106. o2 = Instance.new("LocalScript")
  107. o1.Name = "OPSwords"
  108. o1.Parent = mas
  109. o1.TextureId = "http://www.roblox.com/asset/?id=23722071"
  110. o2.Name = "AnimDeath"
  111. o2.Parent = o1
  112. table.insert(cors,coroutine.create(function()
  113. wait()
  114. runDummyScript(function()
  115. print("Animator Loaded.");
  116.  
  117. --Animation Manager--
  118. local bin = script.Parent;
  119. while (game.Players.LocalPlayer.Character == nil) do
  120. wait()
  121. end
  122. print("Player found. :)");
  123. local player = Owner
  124. local human = player.Humanoid;
  125.  
  126. --Tool Variables--
  127. local tselected = false;
  128.  
  129. --Base Part--
  130. local block = Instance.new("Part");
  131. block.FormFactor = "Symmetric";
  132. block.Size = Vector3.new(1, 1, 1);
  133. block.Transparency = 1;
  134. block.CanCollide = false;
  135. block.Locked = true;
  136.  
  137. local sword = Instance.new("Part");
  138. sword.FormFactor = "Plate";
  139. sword.Shape = "Block";
  140. sword.Size = Vector3.new(1, 0.8, 4);
  141. sword.Transparency = 1;
  142. sword.CanCollide = false;
  143. local SlashSound = Instance.new("Sound")
  144. SlashSound.SoundId = "http://www.roblox.com/asset/?id=11998777"
  145. SlashSound.Pitch = 1.4;
  146. SlashSound.Looped = true;
  147. SlashSound.Name = "Voom";
  148. SlashSound.Parent = sword
  149. snd = Instance.new("Sound")
  150. snd.SoundId = "http://www.roblox.com/asset/?id=2233908"
  151. snd.Volume = 1
  152. snd.Name = "Boom"
  153. snd.Parent = sword
  154. local UnsheathSound = Instance.new("Sound")
  155. UnsheathSound.SoundId = "http://www.roblox.com/asset/?id=11998770"
  156. UnsheathSound.Name = "Go"
  157. UnsheathSound.Volume = 0.5
  158. UnsheathSound.Parent = sword
  159. local mesh = Instance.new("SpecialMesh");
  160. mesh.MeshType = "FileMesh";
  161. mesh.MeshId = "http://www.roblox.com/asset/?id=11996935";
  162. mesh.Scale = Vector3.new(1.4,1.4,1.4);
  163. mesh.TextureId = "http://www.roblox.com/asset/?id=23719291";
  164. mesh.Parent = sword;
  165. local sparkle = Instance.new("Sparkles")
  166. sparkle.SparkleColor = Color3.new(0, 255, 155);
  167. sparkle.Parent = sword;
  168. sparkle.Enabled = false;
  169. local sword2 = sword:Clone();
  170.  
  171. local lsweld = Instance.new("Weld");
  172. local rsweld = Instance.new("Weld");
  173. --Left Arm Positioners and Welders--
  174. local lPosBase = block:Clone();
  175. local lPosWeld = Instance.new("Weld");
  176. local lRotBase = block:Clone();
  177. local lRotWeld = Instance.new("Weld");
  178. local lArmWeld = Instance.new("Weld");
  179.  
  180. --Right Arm Positioners and Welders--
  181. local rPosBase = block:Clone();
  182. local rPosWeld = Instance.new("Weld");
  183. local rRotBase = block:Clone();
  184. local rRotWeld = Instance.new("Weld");
  185. local rArmWeld = Instance.new("Weld");
  186.  
  187. --Head Welder--
  188. local hRotBase = block:Clone();
  189. local hRotWeld = Instance.new("Weld");
  190. local headWeld = Instance.new("Weld");
  191.  
  192. --Bind the base parts to the Torso. Tricky.
  193.  
  194. --Left--
  195. lPosBase.Name = "LPosBase";
  196. lPosWeld.Name = "LPosWeld";
  197. lRotBase.Name = "LRotBase";
  198. lRotWeld.Name = "LRotWeld";
  199. lPosWeld.Part0 = player.Torso;
  200. lPosWeld.Part1 = lPosBase;
  201. lPosWeld.C1 = CFrame.new(1.5, -0.5, 0);
  202. lPosWeld.Parent = player.Torso;
  203. lPosBase.Parent = player;
  204. lRotWeld.Part0 = lPosBase;
  205. lRotWeld.Part1 = lRotBase;
  206. lRotWeld.Parent = player.Torso;
  207. lRotBase.Parent = player;
  208. lArmWeld.Part0 = lRotBase;
  209. lArmWeld.C1 = CFrame.new(0, 0.5, 0);
  210. lArmWeld.Parent = player.Torso;
  211.  
  212. --Right--
  213. rPosBase.Name = "RPosBase";
  214. rPosWeld.Name = "RPosWeld";
  215. rRotBase.Name = "RRotBase";
  216. rRotWeld.Name = "RRotWeld";
  217. rPosWeld.Part0 = player.Torso;
  218. rPosWeld.Part1 = rPosBase;
  219. rPosWeld.C1 = CFrame.new(-1.5, -0.5, 0);
  220. rPosWeld.Parent = player.Torso;
  221. rPosBase.Parent = player;
  222. rRotWeld.Part0 = rPosBase;
  223. rRotWeld.Part1 = rRotBase;
  224. rRotWeld.Parent = player.Torso;
  225. rRotBase.Parent = player;
  226. rArmWeld.Part0 = rRotBase;
  227. rArmWeld.C1 = CFrame.new(0, 0.5, 0);
  228. rArmWeld.Parent = player.Torso;
  229.  
  230. --Head--
  231. hRotBase.Name = "HRotBase";
  232. hRotWeld.Name = "HRotWeld";
  233. headWeld.Name = "HeadWeld";
  234. hRotWeld.Part0 = player.Torso;
  235. hRotWeld.Part1 = hRotBase;
  236. hRotWeld.C1 = CFrame.new(0, -1.5, 0);
  237. hRotWeld.Parent = player.Torso;
  238. hRotBase.Parent = player;
  239. headWeld.Part0 = hRotBase;
  240. headWeld.Parent = player.Torso;
  241.  
  242. --Le Swords--
  243. lsweld.Part0 = lRotBase;
  244. rsweld.Part0 = rRotBase;
  245. lsweld.Part1 = sword;
  246. rsweld.Part1 = sword2;
  247. lsweld.C1 = CFrame.new(0, 0, -3.5)*CFrame.Angles(math.rad(270), math.rad(90), 0);
  248. rsweld.C1 = CFrame.new(0, 0, -3.5)*CFrame.Angles(math.rad(270), math.rad(90), 0);
  249. lsweld.Parent = player.Torso;
  250. rsweld.Parent = player.Torso;
  251. sword.Parent = player;
  252. sword2.Parent = player;
  253. sword.Voom:Stop();
  254. sword2.Voom:Stop();
  255. print("Bases binded.");
  256.  
  257. --Binds the arms and head to the base parts.
  258. function bind()
  259. lArmWeld.Part1 = player:FindFirstChild("Left Arm");
  260. rArmWeld.Part1 = player:FindFirstChild("Right Arm");
  261. headWeld.Part1 = player:FindFirstChild("Head");
  262. sword.Transparency = 0;
  263. sword2.Transparency = 0;
  264. sword.Go:Play();
  265. sword2.Go:Play();
  266. sword.Sparkles.Enabled = true;
  267. sword2.Sparkles.Enabled = true;
  268. human.WalkSpeed = 28;
  269. sword.Voom:Play();
  270. sword2.Voom:Play();
  271. end
  272.  
  273. --Releases the arms and head from the base parts.
  274. function unbind()
  275. lArmWeld.Part1 = nil;
  276. rArmWeld.Part1 = nil;
  277. headWeld.Part1 = nil;
  278. sword.Transparency = 1;
  279. sword2.Transparency = 1;
  280. sword.Sparkles.Enabled = false;
  281. sword2.Sparkles.Enabled = false;
  282. human.WalkSpeed = 28;
  283. sword.Go:Play();
  284. sword2.Go:Play();
  285. sword.Voom:Stop();
  286. sword2.Voom:Stop();
  287. end
  288.  
  289. function boom(part)
  290. wait();
  291. if part == nil or tselected == false then return end;
  292. if part.Anchored then return end;
  293. if part.Parent == player or part.Parent.Parent == player then return end;
  294. human:TakeDamage(-1);
  295. sword.Sparkles:Clone().Parent = part;
  296. sword.Go:Play();
  297. sword2.Go:Play();
  298. wait(0.5)
  299. part:BreakJoints();
  300. 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));
  301. game.Debris:AddItem(part, 10);
  302. end
  303.  
  304. local load = true;
  305.  
  306. function selected(mouse)
  307. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  308. bind();
  309. human.MaxHealth = 9999999;
  310. if player:FindFirstChild("ForceField") then
  311. player.ForceField:Destroy();
  312. end
  313. tselected = true;
  314. mouse.Button1Down:connect(function()
  315. if (load) then
  316. mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
  317. load = false
  318. sword.Boom:Play();
  319. sword2.Boom:Play();
  320. local e = Instance.new("Explosion");
  321. e.Hit:connect(boom);
  322. e.Position = player.Torso.Position;
  323. e.BlastPressure = 0;
  324. e.BlastRadius = 1000;
  325. e.Parent = game.Workspace;
  326. human:TakeDamage(50);
  327. wait(1)
  328. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  329. load = true
  330. end
  331. end)
  332. while tselected do
  333. lRotWeld.C1 = CFrame.Angles(math.rad(math.random(0, 360)), math.rad(math.random(0, 360)), math.rad(math.random(0, 360)));
  334. rRotWeld.C1 = CFrame.Angles(math.rad(math.random(0, 360)), math.rad(math.random(0, 360)), math.rad(math.random(0, 360)));
  335. human:TakeDamage(-0.25);
  336. wait();
  337. end
  338. end
  339.  
  340. function deselected()
  341. tselected = false;
  342. unbind();
  343. human.MaxHealth = 9999999;
  344. end
  345.  
  346. --Event Listeners--
  347. sword.Touched:connect(boom);
  348. sword2.Touched:connect(boom);
  349. 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);
  350. --Tool--
  351. bin.Selected:connect(selected);
  352. bin.Deselected:connect(deselected);
  353. end,o2)
  354. end))
  355. mas.Parent = workspace
  356. mas:MakeJoints()
  357. local mas1 = mas:GetChildren()
  358. for i=1,#mas1 do
  359. mas1[i].Parent = game:GetService("Players").LocalPlayer.Backpack
  360. ypcall(function() mas1[i]:MakeJoints() end)
  361. end
  362. mas:Destroy()
  363. for i=1,#cors do
  364. coroutine.resume(cors[i])
  365. end
Advertisement
Add Comment
Please, Sign In to add comment