Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
- local Player,game,owner = owner,game
- local RealPlayer = Player
- do
- print("FE Compatibility code by Mokiros")
- local rp = RealPlayer
- script.Parent = rp.Character
- --RemoteEvent for communicating
- local Event = Instance.new("RemoteEvent")
- Event.Name = "UserInput_Event"
- --Fake event to make stuff like Mouse.KeyDown work
- local function fakeEvent()
- local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
- t.connect = t.Connect
- return t
- end
- --Creating fake input objects with fake variables
- local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
- local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
- local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
- CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
- end}
- --Merged 2 functions into one by checking amount of arguments
- CAS.UnbindAction = CAS.BindAction
- --This function will trigger the events that have been :Connect()'ed
- local function te(self,ev,...)
- local t = m[ev]
- if t and t._fakeEvent then
- for _,f in pairs(t.Functions) do
- f(...)
- end
- end
- end
- m.TrigEvent = te
- UIS.TrigEvent = te
- Event.OnServerEvent:Connect(function(plr,io)
- if plr~=rp then return end
- m.Target = io.Target
- m.Hit = io.Hit
- if not io.isMouse then
- local b = io.UserInputState == Enum.UserInputState.Begin
- if io.UserInputType == Enum.UserInputType.MouseButton1 then
- return m:TrigEvent(b and "Button1Down" or "Button1Up")
- end
- for _,t in pairs(CAS.Actions) do
- for _,k in pairs(t.Keys) do
- if k==io.KeyCode then
- t.Function(t.Name,io.UserInputState,io)
- end
- end
- end
- m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
- UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
- end
- end)
- Event.Parent = NLS([==[
- local Player = game:GetService("Players").LocalPlayer
- local Event = script:WaitForChild("UserInput_Event")
- local Mouse = Player:GetMouse()
- local UIS = game:GetService("UserInputService")
- local input = function(io,a)
- if a then return end
- --Since InputObject is a client-side instance, we create and pass table instead
- Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
- end
- UIS.InputBegan:Connect(input)
- UIS.InputEnded:Connect(input)
- local h,t
- --Give the server mouse data 30 times every second, but only if the values changed
- --If player is not moving their mouse, client won't fire events
- while wait(1/30) do
- if h~=Mouse.Hit or t~=Mouse.Target then
- h,t=Mouse.Hit,Mouse.Target
- Event:FireServer({isMouse=true,Target=t,Hit=h})
- end
- end]==],Player.Character)
- ----Sandboxed game object that allows the usage of client-side methods and services
- --Real game object
- local _rg = game
- --Metatable for fake service
- local fsmt = {
- __index = function(self,k)
- local s = rawget(self,"_RealService")
- if s then return s[k] end
- end,
- __newindex = function(self,k,v)
- local s = rawget(self,"_RealService")
- if s then s[k]=v end
- end,
- __call = function(self,...)
- local s = rawget(self,"_RealService")
- if s then return s(...) end
- end
- }
- local function FakeService(t,RealService)
- t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
- return setmetatable(t,fsmt)
- end
- --Fake game object
- local g = {
- GetService = function(self,s)
- return self[s]
- end,
- Players = FakeService({
- LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
- },"Players"),
- UserInputService = FakeService(UIS,"UserInputService"),
- ContextActionService = FakeService(CAS,"ContextActionService"),
- }
- rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
- g.service = g.GetService
- g.RunService = FakeService({
- RenderStepped = _rg:GetService("RunService").Heartbeat,
- BindToRenderStep = function(self,name,_,fun)
- end,
- UnbindFromRenderStep = function(self,name)
- self._btrs[name]:Disconnect()
- end,
- },"RunService")
- setmetatable(g,{
- __index=function(self,s)
- return _rg:GetService(s) or typeof(_rg[s])=="function"
- and function(_,...)return _rg[s](_rg,...)end or _rg[s]
- end,
- __newindex = fsmt.__newindex,
- __call = fsmt.__call
- })
- --Changing owner to fake player object to support owner:GetMouse()
- game,owner = g,g.Players.LocalPlayer
- end
- ---------------------------||FE Covert||---------------------------
- local player = owner
- local char = player.Character
- --par = workspace:FindFirstChild("PATH")
- shi1 = workspace:FindFirstChild("Shield1")
- shi2 = workspace:FindFirstChild("Shield2")
- shi3 = workspace:FindFirstChild("Shield3")
- shi4 = workspace:FindFirstChild("Shield4")
- shi5 = workspace:FindFirstChild("Shield5")
- shi6 = workspace:FindFirstChild("Shield6")
- weld1 =char:FindFirstChild("weld1")
- weld2 =char:FindFirstChild("weld2")
- weld3 =char:FindFirstChild("weld3")
- weld4 =char:FindFirstChild("weld4")
- weld5 =char:FindFirstChild("weld5")
- weld6 =char:FindFirstChild("weld6")
- --if par == nil then
- --para = Instance.new("Part",workspace)
- --para.Name = "PATH"
- --end
- if shi1 == nil then
- shi1= Instance.new("Part",workspace)
- shi1.Name = "Shield1"
- shi1.Transparency =0.9
- shi1.Position = char.Head.Position
- shi1.Size = char.Head.Size
- shi1.Anchored = false
- shi1.CanCollide = false
- end
- if shi2 == nil then
- shi2= Instance.new("Part",workspace)
- shi2.Name = "Shield2"
- shi2.Transparency =0.9
- shi2.Position = char.Torso.Position
- shi2.Size = char.Torso.Size
- shi2.Anchored = false
- shi2.CanCollide = false
- end
- if shi3 == nil then
- shi3= Instance.new("Part",workspace)
- shi3.Name = "Shield3"
- shi3.Transparency =0.9
- shi3.Position = char["Right Leg"].Position
- shi3.Size = char["Right Leg"].Size
- shi3.Anchored = false
- shi3.CanCollide = false
- end
- if shi4 == nil then
- shi4= Instance.new("Part",workspace)
- shi4.Name = "Shield4"
- shi4.Transparency =0.9
- shi4.Position = char["Left Leg"].Position
- shi4.Size = char["Left Leg"].Size
- shi4.Anchored = false
- shi4.CanCollide = false
- end
- if shi5 == nil then
- shi5= Instance.new("Part",workspace)
- shi5.Name = "Shield5"
- shi5.Transparency =0.9
- shi5.Position =char["Right Arm"].Position
- shi5.Size = char["Right Arm"].Size
- shi5.Anchored = false
- shi5.CanCollide = false
- end
- if shi6 == nil then
- shi6= Instance.new("Part",workspace)
- shi6.Name = "Shield6"
- shi6.Transparency =0.9
- shi6.Position =char["Left Arm"].Position
- shi6.Size = char["Left Arm"].Size
- shi6.Anchored = false
- shi6.CanCollide = false
- end
- if weld1 == nil then
- welde = Instance.new("Weld",char)
- welde.Name = "weld1"
- welde.Part0 = char.Head
- welde.Part1 = shi1
- end
- if weld2 == nil then
- welde = Instance.new("Weld",char)
- welde.Name = "weld2"
- welde.Part0 = char.Torso
- welde.Part1 = shi2
- end
- if weld3 == nil then
- welde = Instance.new("Weld",char)
- welde.Name = "weld3"
- welde.Part0 = char["Right Leg"]
- welde.Part1 = shi3
- end
- if weld4 == nil then
- welde = Instance.new("Weld",char)
- welde.Name = "weld4"
- welde.Part0 = char["Left Leg"]
- welde.Part1 = shi4
- end
- if weld5 == nil then
- welde = Instance.new("Weld",char)
- welde.Name = "weld5"
- welde.Part0 = char["Right Arm"]
- welde.Part1 = shi5
- end
- if weld6 == nil then
- welde = Instance.new("Weld",char)
- welde.Name = "weld6"
- welde.Part0 = char["Left Arm"]
- welde.Part1 = shi6
- end
- script.Parent = Player.PlayerGui
- --par = workspace:FindFirstChild("PATH")
- shi1 = workspace:FindFirstChild("Shield1")
- shi2 = workspace:FindFirstChild("Shield2")
- shi3 = workspace:FindFirstChild("Shield3")
- shi4 = workspace:FindFirstChild("Shield4")
- shi5 = workspace:FindFirstChild("Shield5")
- shi6 = workspace:FindFirstChild("Shield6")
- weld1 =char:FindFirstChild("weld1")
- weld2 =char:FindFirstChild("weld2")
- weld3 =char:FindFirstChild("weld3")
- weld4 =char:FindFirstChild("weld4")
- weld5 =char:FindFirstChild("weld5")
- weld6 =char:FindFirstChild("weld6")
- --local mouse = player:GetMouse()
- x = 0
- y = 0
- z = 0
- or shi2 == nil or shi3 == nil or shi4 == nil or shi5 == nil or shi6 == nil
- function Shild()
- if shi1 == nil then
- shi1 = Instance.new("Part",workspace)
- shi1.Name ="Shield2"
- shi1.Position = char.Head.Position
- shi1.Size = char.Head.Size
- weld1 = Instance.new("Weld",char)
- weld1.Part0 = char.Head
- weld1.Part1 = shi1
- end
- if shi2 == nil then
- shi2 = Instance.new("Part",workspace)
- shi2.Name ="Shield2"
- shi2.Position = char.Torso.Position
- shi2.Size = char.Torso.Size
- weld2 = Instance.new("Weld",char)
- weld2.Part0 = char.Torso
- weld2.Part1 = shi2
- end
- if shi3 == nil then
- shi3 = Instance.new("Part",workspace)
- shi3.Name ="Shield3"
- shi3.Position = char["Right Leg"].Position
- shi3.Size = char["Right Leg"].Size
- weld3 = Instance.new("Weld",char)
- weld3.Part0 = char["Right Leg"]
- weld3.Part1 = shi3
- end
- if shi4 == nil then
- shi4 = Instance.new("Part",workspace)
- shi4.Name ="Shield3"
- shi4.Position = char["Left Leg"].Position
- shi4.Size = char["Left Leg"].Size
- weld4 = Instance.new("Weld",char)
- weld4.Part0 = char["Left Leg"]
- weld4.Part1 = shi4
- end
- if shi5 == nil then
- shi5 = Instance.new("Part",workspace)
- shi5.Name ="Shield3"
- shi5.Position = char["Right Arm"].Position
- shi5.Size = char["Right Arm"].Size
- weld5 = Instance.new("Weld",char)
- weld5.Part0 = char["Right Arm"]
- weld5.Part1 = shi5
- end
- if shi6 == nil then
- shi6 = Instance.new("Part",workspace)
- shi6.Name ="Shield3"
- shi6.Position = char["Left Arm"].Position
- shi6.Size = char["Left Leg"].Size
- weld6 = Instance.new("Weld",char)
- weld6.Part0 = char["Left Arm"]
- weld6.Part1 = shi6
- end
- -- if char:FindFirstChild("welded") == nil then
- -- weld = Instance.new("Weld",char)
- -- weld.Name = "welded"
- -- weld.Part0 = char.Torso
- -- weld.Part1 = shi
- -- end
- end
- --function flypath()
- -- if workspace:FindFirstChild("PATH") ==nil then
- -- par = Instance.new("Part",workspace)
- -- par.Name ="PATH"
- -- par.Position = Vector3.new(char.Torso.Position.x,char.Torso.Position.y - 3.025+ y,char.Torso.Position.z)
- -- par.Anchored = true
- -- par.Size = Vector3.new(50,0.005,50)
- -- par.Transparency = 0.9
- -- par.Orientation = Vector3.new(char.Torso.Orientation.x, 0, char.Torso.Orientation.z)
- -- else
- -- par.Position = Vector3.new(char.Torso.Position.x + x,char.Torso.Position.y - 3.025+ y,char.Torso.Position.z)
- -- par.Anchored = true
- -- par.Size = Vector3.new(50,0.005,50)
- -- par.Transparency = 0.9
- -- par.Orientation = Vector3.new(0, 0, 0)
- -- end
- --end
- mouse.KeyDown:connect(function(key)
- k = key
- if k == "q" then
- y = - 1
- end
- if k == "e" then
- y =1
- end
- end)
- mouse.KeyUp:connect(function(key)
- k = key
- if k == "q" then
- y = 0
- end
- if k == "e" then
- y =0
- end
- end)
- while wait(1/60) do
- Shild()
- -- flypath()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement