Advertisement
basbas1234

Test

Dec 17th, 2019
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 11.24 KB | None | 0 0
  1. if game:GetService("RunService"):IsClient()then error("Please run as a server script. Use h/ instead of hl/.")end;print("FE Compatibility: by WaverlyCole");InternalData = {}
  2. do
  3.     script.Parent = owner.Character
  4.     local Event = Instance.new("RemoteEvent");Event.Name = "UserInput"
  5.     local function NewFakeEvent()
  6.         local Bind = Instance.new("BindableEvent")
  7.         local Fake;Fake = {Connections = {},
  8.         fakeEvent=true;
  9.         Connect=function(self,Func)
  10.             Bind.Event:connect(Func)
  11.             self.Connections[Bind] = true
  12.             return setmetatable({Connected = true},{
  13.             __index = function (self,Index)
  14.                 if Index:lower() == "disconnect" then
  15.                     return function() Fake.Connections[Bind] = false;self.Connected = false end
  16.                 end
  17.                 return Fake[Index]
  18.             end;
  19.             __tostring = function() return "Connection" end;
  20.         })
  21.         end}
  22.         Fake.connect = Fake.Connect;return Fake;
  23.     end
  24.     local Mouse = {Target=nil,Hit=CFrame.new(),KeyUp=NewFakeEvent(),KeyDown=NewFakeEvent(),Button1Up=NewFakeEvent(),Button1Down=NewFakeEvent()}
  25.     local UserInputService = {InputBegan=NewFakeEvent(),InputEnded=NewFakeEvent()}
  26.     local ContextActionService = {Actions={},BindAction = function(self,actionName,Func,touch,...)
  27.         self.Actions[actionName] = Func and {Name=actionName,Function=Func,Keys={...}} or nil
  28.     end};ContextActionService.UnBindAction = ContextActionService.BindAction
  29.     local function TriggerEvent(self,Event,...)
  30.         local Trigger = Mouse[Event]
  31.         if Trigger and Trigger.fakeEvent and Trigger.Connections then
  32.             for Connection,Active in pairs(Trigger.Connections) do if Active then Connection:Fire(...) end end
  33.         end
  34.     end
  35.     Mouse.TrigEvent = TriggerEvent;UserInputService.TrigEvent = TriggerEvent
  36.     Event.OnServerEvent:Connect(function(FiredBy,Input)
  37.         if FiredBy.Name ~= owner.Name then return end
  38.         if Input.MouseEvent then
  39.             Mouse.Target = Input.Target;Mouse.Hit = Input.Hit
  40.         else
  41.             local Begin = Input.UserInputState == Enum.UserInputState.Begin
  42.             if Input.UserInputType == Enum.UserInputType.MouseButton1 then return Mouse:TrigEvent(Begin and "Button1Down" or "Button1Up") end
  43.             for _,Action in pairs(ContextActionService.Actions) do
  44.                 for _,Key in pairs(Action.Keys) do if Key==Input.KeyCode then Action.Function(Action.Name,Input.UserInputState,Input) end end
  45.             end
  46.             Mouse:TrigEvent(Begin and "KeyDown" or "KeyUp",Input.KeyCode.Name:lower())
  47.             UserInputService:TrigEvent(Begin and "InputBegan" or "InputEnded",Input,false)
  48.         end
  49.     end)
  50.     InternalData["Mouse"] = Mouse;InternalData["ContextActionService"] = ContextActionService;InternalData["UserInputService"] = UserInputService
  51.     Event.Parent = NLS([[
  52.         local Player = owner;local Event = script:WaitForChild("UserInput");local UserInputService = game:GetService("UserInputService");local Mouse = Player:GetMouse()
  53.         local Input = function(Input,gameProcessedEvent)
  54.             if gameProcessedEvent then return end
  55.             Event:FireServer({KeyCode=Input.KeyCode,UserInputType=Input.UserInputType,UserInputState=Input.UserInputState})
  56.         end
  57.         UserInputService.InputBegan:Connect(Input);UserInputService.InputEnded:Connect(Input)
  58.         local Hit,Target
  59.         while wait(1/30) do
  60.             if Hit ~= Mouse.Hit or Target ~= Mouse.Target then
  61.                 Hit,Target = Mouse.Hit,Mouse.Target;Event:FireServer({["MouseEvent"]=true,["Target"]=Target,["Hit"]=Hit})
  62.             end
  63.         end
  64.     ]],owner.Character)
  65. end
  66. RealGame = game;game = setmetatable({},{
  67.     __index = function (self,Index)
  68.         local Sandbox = function (Thing)
  69.             if Thing:IsA("Player") then
  70.                 local RealPlayer = Thing
  71.                 return setmetatable({},{
  72.                     __index = function (self,Index)
  73.                         local Type = type(RealPlayer[Index])
  74.                         if Type == "function" then
  75.                             if Index:lower() == "getmouse" or Index:lower() == "mouse" then
  76.                                 return function (self)return InternalData["Mouse"] end
  77.                             end
  78.                             return function (self,...)return RealPlayer[Index](RealPlayer,...) end
  79.                         end
  80.                         return RealPlayer[Index]
  81.                     end;
  82.                     __tostring = function(self) return RealPlayer.Name end
  83.                 })
  84.             end
  85.         end
  86.         if RealGame[Index] then
  87.             local Type = type(RealGame[Index])
  88.             if Type == "function" then
  89.                 if Index:lower() == "getservice" or Index:lower() == "service" then
  90.                     return function (self,Service)
  91.                         local FakeServices = {
  92.                             ["players"] = function()
  93.                                 return setmetatable({},{
  94.                                     __index = function (self2,Index2)
  95.                                         local RealService = RealGame:GetService(Service)
  96.                                         local Type2 = type(Index2)
  97.                                         if Type2 == "function" then
  98.                                             return function (self,...) return RealService[Index2](RealService,...)end
  99.                                         else
  100.                                             if Index2:lower() == "localplayer" then return Sandbox(owner) end
  101.                                             return RealService[Index2]
  102.                                         end
  103.                                     end;
  104.                                     __tostring = function(self) return RealGame:GetService(Service).Name end
  105.                                 })
  106.                             end;
  107.                             ["contextactionservice"] = function() return InternalData["ContextActionService"] end;
  108.                             ["userinputservice"] = function() return InternalData["UserInputService"] end;
  109.                             ["runservice"] = function()
  110.                                 return setmetatable({},{
  111.                                     __index = function(self2,Index2)
  112.                                         local RealService = RealGame:GetService(Service)
  113.                                         local Type2 = type(Index2)
  114.                                         if Type2 == "function" then
  115.                                             return function (self,...) return RealService[Index2](RealService,...) end
  116.                                         else
  117.                                             local RunServices = {
  118.                                                 ["bindtorenderstep"] = function() return function (self,Name,Priority,Function) return RealGame:GetService("RunService").Stepped:Connect(Function) end end;
  119.                                                 ["renderstepped"] = function() return RealService["Stepped"] end
  120.                                             }
  121.                                             if RunServices[Index2:lower()] then return RunServices[Index2:lower()]() end
  122.                                             return RealService[Index2]
  123.                                         end
  124.                                     end
  125.                                 })
  126.                             end
  127.                         }
  128.                         if FakeServices[Service:lower()] then return FakeServices[Service:lower()]() end
  129.                         return RealGame:GetService(Service)
  130.                     end
  131.                 end
  132.                 return function (self,...) return RealGame[Index](RealGame,...) end
  133.             else
  134.                 if game:GetService(Index) then return game:GetService(Index) end
  135.                 return RealGame[Index]
  136.             end
  137.         end
  138.         return nil
  139.     end
  140. });Game = game;owner = game:GetService("Players").LocalPlayer;script = Instance.new("Script");print("Complete! Running...")
  141.  
  142. wait(1/60)
  143. Dummy = game.Players.LocalPlayer.Character
  144. Torso = Dummy.Torso
  145. TorsoPos = Torso.CFrame
  146. h = Dummy.Humanoid
  147. local spawnCF = Torso.CFrame
  148.  
  149. function PixelBlockNeg(bonuspeed,FastSpeed,type,transparentanim,pos,x1,y1,z1,value,color,outerpos)
  150. local type = type
  151. local rng = Instance.new("Part", workspace)
  152. rng.Anchored = true
  153. rng.BrickColor = color
  154. rng.CanCollide = false
  155. rng.FormFactor = 3
  156. rng.Name = "Ring"
  157. rng.Material = "Neon"
  158. rng.Size = Vector3.new(1, 1, 1)
  159. rng.Transparency = 0
  160. rng.TopSurface = 0
  161. rng.BottomSurface = 0
  162. rng.CFrame = pos
  163. rng.CFrame = rng.CFrame + rng.CFrame.lookVector*outerpos
  164. local rngm = Instance.new("SpecialMesh", rng)
  165. rngm.MeshType = "Brick"
  166. rngm.Scale = Vector3.new(x1,y1,z1)
  167. local scaler2 = 0
  168. local speeder = FastSpeed/10
  169. if type == "Add" then
  170. scaler2 = 1*value
  171. elseif type == "Divide" then
  172. scaler2 = 1/value
  173. end
  174. coroutine.resume(coroutine.create(function()
  175. for i = 0,10/bonuspeed,0.1 do
  176. wait()
  177. if type == "Add" then
  178. scaler2 = scaler2 - 0.01*value/bonuspeed
  179. elseif type == "Divide" then
  180. scaler2 = scaler2 - 0.01/value*bonuspeed
  181. end
  182. speeder = speeder + 0.01*FastSpeed*bonuspeed/10
  183. rng.CFrame = rng.CFrame + rng.CFrame.lookVector*speeder*bonuspeed
  184. if transparentanim == true then
  185.     rng.Transparency = rng.Transparency + 0.01*bonuspeed
  186. end
  187. rngm.Scale = rngm.Scale - Vector3.new(scaler2*bonuspeed, scaler2*bonuspeed, scaler2*bonuspeed)
  188. end
  189. rng:Destroy()
  190. end))
  191. end
  192.  
  193. function FindAscendant(Oject, Class)
  194.     local Current = Oject
  195.     local Result = nil
  196.     pcall(function()
  197.         repeat
  198.             if Current.Parent == workspace then
  199.                 break
  200.             else
  201.                 Current = Current.Parent
  202.             end
  203.             if Current:IsA(Class) then
  204.                 Result = Current
  205.                 break
  206.             end
  207.         until Current == nil
  208.     end)
  209.     return Result
  210. end
  211.  
  212. function GetEmenyFromChild(Child)
  213.     local Emeny = FindAscendant(Child, 'Model')
  214.     if (Emeny and Emeny ~= Dummy) then
  215.         local EmenyHumanoid = Emeny:FindFirstChildOfClass('Humanoid')
  216.         if (EmenyHumanoid and EmenyHumanoid.Health > 0) then
  217.             return Emeny
  218.         else
  219.             return nil
  220.         end
  221.     else
  222.         return nil
  223.     end
  224. end
  225.  
  226. function CreateShield()
  227.     shield = Instance.new("Part",workspace)
  228.     shield.Shape = "Block"
  229.     shield.Size = Vector3.new(15,15,15)
  230.     shield.BrickColor = BrickColor.new("Really red")
  231.     shield.CFrame = TorsoPos
  232.     shield.Transparency = 0.5
  233.     shield.CanCollide = false
  234.     shield.Anchored = false
  235.     shield.Name = "shield"
  236.     shield.Material = "Neon"
  237.    
  238.     local Weld = Instance.new("Weld")
  239.     Weld.Part0 = Torso
  240.     Weld.Part1 = shield
  241.     Weld.Parent = Dummy
  242. end
  243.  
  244. CreateShield()
  245.  
  246. shield = game.Workspace.shield
  247.  
  248. shield.Touched:Connect(function(hit)
  249.     local Enemy = GetEmenyFromChild(hit)
  250.     if Enemy then
  251.         local CF = hit.CFrame
  252.         for i = 0, 1, 0.1 do
  253.            
  254.             PixelBlockNeg(2,1,"Add",true,CF*CFrame.Angles(math.rad(math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360))),1,1,1,0.01,BrickColor.new("Really red"),0)
  255.         end
  256.        
  257.        
  258.         Enemy:Destroy()
  259.     end
  260. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement