Advertisement
Michael91

FE Test Script 1

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