Advertisement
waconline

flash

Jan 28th, 2020
647
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.91 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,game,owner = owner,game
  4. local RealPlayer = Player
  5. do
  6. print("FE Compatibility code V2 by Mokiros")
  7. local RealPlayer = RealPlayer
  8. script.Parent = RealPlayer.Character
  9.  
  10. --Fake event to make stuff like Mouse.KeyDown work
  11. local Disconnect_Function = function(this)
  12. this[1].Functions[this[2]] = nil
  13. end
  14. local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}}
  15. local FakeEvent_Metatable = {__index={
  16. Connect = function(this,f)
  17. local i = tostring(math.random(0,10000))
  18. while this.Functions[i] do
  19. i = tostring(math.random(0,10000))
  20. end
  21. this.Functions[i] = f
  22. return setmetatable({this,i},Disconnect_Metatable)
  23. end
  24. }}
  25. FakeEvent_Metatable.__index.connect = FakeEvent_Metatable.__index.Connect
  26. local function fakeEvent()
  27. return setmetatable({Functions={}},FakeEvent_Metatable)
  28. end
  29.  
  30. --Creating fake input objects with fake variables
  31. local FakeMouse = {Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  32. FakeMouse.keyUp = FakeMouse.KeyUp
  33. FakeMouse.keyDown = FakeMouse.KeyDown
  34. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  35. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  36. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  37. end}
  38. --Merged 2 functions into one by checking amount of arguments
  39. CAS.UnbindAction = CAS.BindAction
  40.  
  41. --This function will trigger the events that have been :Connect()'ed
  42. local function TriggerEvent(self,ev,...)
  43. for _,f in pairs(self[ev].Functions) do
  44. f(...)
  45. end
  46. end
  47. FakeMouse.TriggerEvent = TriggerEvent
  48. UIS.TriggerEvent = TriggerEvent
  49.  
  50. --Client communication
  51. local Event = Instance.new("RemoteEvent")
  52. Event.Name = "UserInput_Event"
  53. Event.OnServerEvent:Connect(function(plr,io)
  54. if plr~=RealPlayer then return end
  55. FakeMouse.Target = io.Target
  56. FakeMouse.Hit = io.Hit
  57. if not io.isMouse then
  58. local b = io.UserInputState == Enum.UserInputState.Begin
  59. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  60. return FakeMouse:TriggerEvent(b and "Button1Down" or "Button1Up")
  61. end
  62. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  63. return FakeMouse:TriggerEvent(b and "Button2Down" or "Button2Up")
  64. end
  65. for _,t in pairs(CAS.Actions) do
  66. for _,k in pairs(t.Keys) do
  67. if k==io.KeyCode then
  68. t.Function(t.Name,io.UserInputState,io)
  69. end
  70. end
  71. end
  72. FakeMouse:TriggerEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  73. UIS:TriggerEvent(b and "InputBegan" or "InputEnded",io,false)
  74. end
  75. end)
  76. Event.Parent = NLS([==[local Event = script:WaitForChild("UserInput_Event")
  77. local Mouse = owner:GetMouse()
  78. local UIS = game:GetService("UserInputService")
  79. local input = function(io,RobloxHandled)
  80. if RobloxHandled then return end
  81. --Since InputObject is a client-side instance, we create and pass table instead
  82. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  83. end
  84. UIS.InputBegan:Connect(input)
  85. UIS.InputEnded:Connect(input)
  86.  
  87. local h,t
  88. --Give the server mouse data every second frame, but only if the values changed
  89. --If player is not moving their mouse, client won't fire events
  90. local HB = game:GetService("RunService").Heartbeat
  91. while true do
  92. if h~=Mouse.Hit or t~=Mouse.Target then
  93. h,t=Mouse.Hit,Mouse.Target
  94. Event:FireServer({isMouse=true,Target=t,Hit=h})
  95. end
  96. --Wait 2 frames
  97. for i=1,2 do
  98. HB:Wait()
  99. end
  100. end]==],script)
  101.  
  102. ----Sandboxed game object that allows the usage of client-side methods and services
  103. --Real game object
  104. local RealGame = game
  105.  
  106. --Metatable for fake service
  107. local FakeService_Metatable = {
  108. __index = function(self,k)
  109. local s = rawget(self,"_RealService")
  110. if s then
  111. return typeof(s[k])=="function"
  112. and function(_,...)return s[k](s,...)end or s[k]
  113. end
  114. end,
  115. __newindex = function(self,k,v)
  116. local s = rawget(self,"_RealService")
  117. if s then s[k]=v end
  118. end
  119. }
  120. local function FakeService(t,RealService)
  121. t._RealService = typeof(RealService)=="string" and RealGame:GetService(RealService) or RealService
  122. return setmetatable(t,FakeService_Metatable)
  123. end
  124.  
  125. --Fake game object
  126. local FakeGame = {
  127. GetService = function(self,s)
  128. return rawget(self,s) or RealGame:GetService(s)
  129. end,
  130. Players = FakeService({
  131. LocalPlayer = FakeService({GetMouse=function(self)return FakeMouse end},Player)
  132. },"Players"),
  133. UserInputService = FakeService(UIS,"UserInputService"),
  134. ContextActionService = FakeService(CAS,"ContextActionService"),
  135. RunService = FakeService({
  136. _btrs = {},
  137. RenderStepped = RealGame:GetService("RunService").Heartbeat,
  138. BindToRenderStep = function(self,name,_,fun)
  139. self._btrs[name] = self.Heartbeat:Connect(fun)
  140. end,
  141. UnbindFromRenderStep = function(self,name)
  142. self._btrs[name]:Disconnect()
  143. end,
  144. },"RunService")
  145. }
  146. rawset(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer)
  147. FakeGame.service = FakeGame.GetService
  148. FakeService(FakeGame,game)
  149. --Changing owner to fake player object to support owner:GetMouse()
  150. game,owner = FakeGame,FakeGame.Players.LocalPlayer
  151. end
  152. local player=game.Players.LocalPlayer
  153. local char=player.Character
  154. repeat wait() until player and char
  155. local torso=char.Torso
  156. local head=char.Head
  157. local human=char.Humanoid
  158. local hat
  159. for i, v in pairs(char:children()) do if v:isA("Hat") then hat=v end end
  160. local arm={Left=char["Left Arm"], Right=char["Right Arm"]}
  161. local leg={Left=char["Left Leg"], Right=char["Right Leg"]}
  162. local c=function(f) coroutine.resume(coroutine.create(f)) end
  163. pcall(function() torso.roblox:clone().Parent=fake.Torso torso.roblox:remove() head.face:remove() for i, v in pairs(char:children()) do if v.ClassName=="Hat" then v:remove() end v.Transparency=1 end end)
  164. local add={
  165. Part=function(par, a, c, col, t, s, cf)
  166. local p=Instance.new("Part", par) p.TopSurface="Smooth" p.BottomSurface="Smooth" p.formFactor="Custom" p.Anchored=a p.CanCollide=c p.BrickColor=BrickColor.new(col) p.Transparency=t p.Size=s p.CFrame=cf or CFrame.new()
  167. return p
  168. end,
  169. Weld=function(par, p1, cf)
  170. local w=Instance.new("Weld", par) w.Part0=w.Parent or par w.Part1=p1 w.C1=cf or CFrame.new()
  171. return w
  172. end,
  173. Mesh=function(ins, par, s, of, t)
  174. local m=Instance.new(ins, par) m.Scale=s or Vector3.new() m.Offset=of or Vector3.new() pcall(function() m.MeshType=t end)
  175. return m
  176. end
  177. }
  178. local scriptname="Flash"
  179. pcall(function() char[scriptname]:remove() end)
  180. local model=Instance.new("Model", char) model.Name=scriptname
  181. local bin=Instance.new("HopperBin", player.Backpack) bin.Name=model.Name
  182. local skincolor="Really black"
  183. local fake={}
  184. local weld={}
  185. local mesh={}
  186. fake.arm={}
  187. fake.leg={}
  188. fake.torso=nil
  189. fake.Mesh={} fake.Weld={}
  190. --====--
  191. weld.arm={}
  192. weld.leg={}
  193. weld.torso=nil
  194. --====--
  195. mesh.arm={}
  196. mesh.leg={}
  197. --==FAKE, MESH, WELDZ==--
  198. fake.arm.left=add.Part(model, false, false, skincolor, 0, Vector3.new(1, 1, 1), nil)
  199. fake.arm.right=add.Part(model, false, false, skincolor, 0, Vector3.new(1, 1, 1), nil)
  200. fake.leg.left=add.Part(model, false, false, skincolor, 0, Vector3.new(1, 1, 1), nil)
  201. fake.leg.right=add.Part(model, false, false, skincolor, 0, Vector3.new(1, 1, 1), nil)
  202. fake.torso=add.Part(model, false, false, skincolor, 0, Vector3.new(2, 2, 1), nil)
  203. fake.head=head:clone() fake.head.Parent=model fake.head.BrickColor=BrickColor.new(skincolor) fake.head.Transparency=0
  204. -------------------------
  205. mesh.arm.left=add.Mesh("BlockMesh", fake.arm.left, Vector3.new(1, 2, 1), Vector3.new(0, -.5, 0), nil)
  206. mesh.arm.right=add.Mesh("BlockMesh", fake.arm.right, Vector3.new(1, 2, 1), Vector3.new(0, -.5, 0), nil)
  207. mesh.leg.left=add.Mesh("BlockMesh", fake.leg.left, Vector3.new(1, 2, 1), Vector3.new(0, -.5, 0), nil)
  208. mesh.leg.right=add.Mesh("BlockMesh", fake.leg.right, Vector3.new(1, 2, 1), Vector3.new(0, -.5, 0), nil)
  209. -------------------------
  210. weld.arm.left=add.Weld(fake.arm.left, fake.torso, CFrame.new(-1.5, .5, 0))
  211. weld.arm.right=add.Weld(fake.arm.right, fake.torso, CFrame.new(1.5, .5, 0))
  212. weld.leg.left=add.Weld(fake.leg.left, fake.torso, CFrame.new(-.5, -1.5, 0))
  213. weld.leg.right=add.Weld(fake.leg.right, fake.torso, CFrame.new(.5, -1.5, 0))
  214. weld.torso=add.Weld(torso, fake.torso, nil)
  215. weld.head=add.Weld(fake.head, fake.torso, CFrame.new(0, 1.5, 0))
  216. pcall(function() torso.roblox:remove() head.face:remove() for i, v in pairs(char:children()) do if v.ClassName=="Hat" then v:remove() end v.Transparency=1 end end)
  217. --==SIGN==--
  218. fake.Rot=add.Part(model, false, false, "Really black", 0, Vector3.new(1, 1, 1), nil)
  219. fake.Mesh.Rot=add.Mesh("CylinderMesh", fake.Rot, Vector3.new(1.5, .5, 1.5), nil, nil)
  220. fake.Weld.Rot=add.Weld(fake.Rot, fake.torso, CFrame.new(0, 0, -.3)*CFrame.Angles(math.rad(90), 0, 0))
  221. fake.L=add.Part(model, false, false, "Bright yellow", 0, Vector3.new(1, 1, 1), nil)
  222. fake.Mesh.L=add.Mesh("BlockMesh", fake.L, Vector3.new(.25, .5, 1), nil, nil)
  223. fake.Weld.L=add.Weld(fake.L, fake.Rot, CFrame.new(.25, -0.05, 0))
  224. fake.L2=add.Part(model, false, false, "Bright yellow", 0, Vector3.new(1, 1, 1), nil)
  225. fake.Mesh.L2=add.Mesh("BlockMesh", fake.L2, Vector3.new(.75, .5, .25), nil, nil)
  226. fake.Weld.L2=add.Weld(fake.L2, fake.Rot, CFrame.new(0, -0.05, .4))
  227. c(function() for i=0, math.huge, .1 do wait() fake.Weld.Rot.C0=CFrame.Angles(0, i, 0) end end)
  228. --==MANA==--
  229. local gui=Instance.new("ScreenGui", player.PlayerGui)
  230. local label=Instance.new("TextLabel", gui)
  231. label.Text="--==100%==--"
  232. label.Position=UDim2.new(0, 0, 0, 200)
  233. label.Size=UDim2.new(0, 200, 0, 20)
  234. label.BorderColor=BrickColor.Black() label.BackgroundColor=BrickColor.White()
  235. label.TextColor=BrickColor.Black()
  236. local charge=label:clone() charge.Parent=label
  237. charge.Position=UDim2.new()
  238. charge.Text=""
  239. charge.Size=UDim2.new(1, 0, 1, 0)
  240. charge.BorderColor=BrickColor.Black() charge.BackgroundColor=BrickColor.Yellow() charge.Transparency=.5
  241. ----------------------------------------------------------------------------------------------
  242. local walkspeed=100 --Flash :D
  243. local dmg=math.random(5, 10)
  244. local rundeb=false
  245. local tdeb=false
  246. local hDeb=false
  247.  
  248. function hit(h)
  249. local humanoid=h.Parent:findFirstChild("Humanoid")
  250. if humanoid and h.Parent~=char and hDeb==false then
  251. hDeb=true
  252. --c(function()
  253. local fakeP=add.Part(workspace, true, false, "Bright yellow", 0, Vector3.new(1, 1, 1), CFrame.new(h.CFrame.p, torso.CFrame.p))
  254. local mesh=add.Mesh("SpecialMesh", fakeP, Vector3.new(1, 1, 1), nil, "File") mesh.MeshId="http://www.roblox.com/asset/?id=3270017"
  255. c(function()
  256. for i=0, 1, .05 do
  257. wait()
  258. fakeP.Mesh.Scale=fakeP.Mesh.Scale+Vector3.new(i, i, 0)
  259. end
  260. fakeP:remove()
  261. end)
  262. c(function()
  263. for i=0, 1, .05 do
  264. wait()
  265. fakeP.Transparency=i
  266. end
  267. end)
  268. humanoid.Health=humanoid.Health-dmg
  269. local fakeM=Instance.new("Model", workspace) fakeM.Name=dmg
  270. local fakeH=Instance.new("Humanoid", fakeM) fakeH.MaxHealth=0 fakeH.Health=0
  271. local fakeP=add.Part(fakeM, false, false, "Bright red", 0, Vector3.new(1, 1, 1), h.CFrame) fakeP.Name="Head"
  272. local fakeMesh=add.Mesh("CylinderMesh", fakeP, Vector3.new(1, .2, 1), nil, nil)
  273. local bp=Instance.new("BodyPosition", fakeP) bp.maxForce=Vector3.new(math.huge, math.huge, math.huge) bp.position=h.Position+Vector3.new(0, 4, 0)
  274. game.Debris:addItem(fakeM, 2)
  275. pcall(function()h.Parent:findFirstChild("Torso").RotVelocity=fake.torso.RotVelocity*math.random(-1000, 1000)end)
  276. pcall(function()h.Parent:findFirstChild("Torso").Velocity=fake.torso.Velocity*math.random(-1000, 1000)end)
  277. wait()
  278. hDeb=false
  279. --end)
  280. end
  281. end
  282.  
  283. function trail(pos, cf, col)
  284. c(function()
  285. local old=(pos.CFrame*cf).p
  286. while tdeb==true do
  287. wait()
  288. local new=(pos.CFrame*cf).p
  289. local mag=(old-new).magnitude
  290. local dis=(old+new)/2
  291. local trail=add.Part(workspace, true, false, col, 0, Vector3.new(1, mag, 1), CFrame.new(dis, new)*CFrame.new(math.random(-5, 5), math.random(-5, 5), math.random(-5, 5))*CFrame.Angles(math.pi/2, 0, 0))
  292. local tMesh=add.Mesh("CylinderMesh", trail, Vector3.new(.5, 1, .5), nil, nil)
  293. trail.Touched:connect(hit)
  294. old=new
  295. c(function()
  296. for i=1, 0, -.2 do
  297. wait()
  298. trail.Mesh.Scale=trail.Mesh.Scale*Vector3.new(i, 1, i)
  299. end
  300. trail:remove()
  301. end)
  302. c(function()
  303. for i=0, 1, .2 do
  304. wait()
  305. trail.Transparency=i
  306. end
  307. end)
  308. end
  309. end)
  310. end
  311. bin.Selected:connect(function(mouse)
  312. for i, v in pairs(model:children()) do tdeb=true trail(v, CFrame.new(), "Bright yellow") end
  313. c(function() while true do wait() for i, v in pairs(model:children()) do v.Touched:connect(hit) end end end)
  314. human.WalkSpeed=walkspeed
  315. human.MaxHealth=math.huge
  316. human.Running:connect(function(speed)
  317. if speed>0 then
  318. for i=0, 1, .1 do
  319. wait()
  320. weld.torso.C1=CFrame.new(0, 0, 0)*CFrame.Angles(math.rad(15)*i, 0, 0)
  321. weld.arm.left.C1=CFrame.new(-1.5, .5, 0)*CFrame.Angles(-math.rad(45)*i, 0, -math.rad(45)*i)
  322. weld.arm.right.C1=CFrame.new(1.5, .5, 0)*CFrame.Angles(-math.rad(45)*i, 0, math.rad(45)*i)
  323. end
  324. while speed>0 do
  325. wait()
  326. for i=0, 1, .1 do
  327. wait()
  328. weld.leg.left.C1=CFrame.new(-.5, -1.5, 0)*CFrame.Angles(-math.rad(45)*i, 0, 0)
  329. weld.leg.right.C1=CFrame.new(.5, -1.5, 0)*CFrame.Angles(math.rad(45)*i, 0, 0)
  330. weld.arm.left.C1=CFrame.new(-1.5, .5, 0)*CFrame.Angles(-math.rad(45)*i, 0, -math.rad(45))
  331. weld.arm.right.C1=CFrame.new(1.5, .5, 0)*CFrame.Angles(-math.rad(45)-(-math.rad(45)*i), 0, math.rad(45))
  332. end
  333. for i=1, 0, -.1 do
  334. wait()
  335. weld.leg.left.C1=CFrame.new(-.5, -1.5, 0)*CFrame.Angles(-math.rad(45)*i, 0, 0)
  336. weld.leg.right.C1=CFrame.new(.5, -1.5, 0)*CFrame.Angles(math.rad(45)*i, 0, 0)
  337. weld.arm.left.C1=CFrame.new(-1.5, .5, 0)*CFrame.Angles(-math.rad(45)*i, 0, -math.rad(45))
  338. weld.arm.right.C1=CFrame.new(1.5, .5, 0)*CFrame.Angles(-math.rad(45)-(-math.rad(45)*i), 0, math.rad(45))
  339. end
  340. end
  341. end
  342. end)
  343. end)--mediafire
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement