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 V2 by Mokiros")
- local RealPlayer = RealPlayer
- script.Parent = RealPlayer.Character
- --Fake event to make stuff like Mouse.KeyDown work
- local Disconnect_Function = function(this)
- this[1].Functions[this[2]] = nil
- end
- local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}}
- local FakeEvent_Metatable = {__index={
- Connect = function(this,f)
- local i = tostring(math.random(0,10000))
- while this.Functions[i] do
- i = tostring(math.random(0,10000))
- end
- this.Functions[i] = f
- return setmetatable({this,i},Disconnect_Metatable)
- end
- }}
- FakeEvent_Metatable.__index.connect = FakeEvent_Metatable.__index.Connect
- local function fakeEvent()
- return setmetatable({Functions={}},FakeEvent_Metatable)
- end
- --Creating fake input objects with fake variables
- local FakeMouse = {Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
- FakeMouse.keyUp = FakeMouse.KeyUp
- FakeMouse.keyDown = FakeMouse.KeyDown
- 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 TriggerEvent(self,ev,...)
- for _,f in pairs(self[ev].Functions) do
- f(...)
- end
- end
- FakeMouse.TriggerEvent = TriggerEvent
- UIS.TriggerEvent = TriggerEvent
- --Client communication
- local Event = Instance.new("RemoteEvent")
- Event.Name = "UserInput_Event"
- Event.OnServerEvent:Connect(function(plr,io)
- if plr~=RealPlayer then return end
- FakeMouse.Target = io.Target
- FakeMouse.Hit = io.Hit
- if not io.isMouse then
- local b = io.UserInputState == Enum.UserInputState.Begin
- if io.UserInputType == Enum.UserInputType.MouseButton1 then
- return FakeMouse:TriggerEvent(b and "Button1Down" or "Button1Up")
- end
- if io.UserInputType == Enum.UserInputType.MouseButton2 then
- return FakeMouse:TriggerEvent(b and "Button2Down" or "Button2Up")
- 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
- FakeMouse:TriggerEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
- UIS:TriggerEvent(b and "InputBegan" or "InputEnded",io,false)
- end
- end)
- Event.Parent = NLS([==[local Event = script:WaitForChild("UserInput_Event")
- local Mouse = owner:GetMouse()
- local UIS = game:GetService("UserInputService")
- local input = function(io,RobloxHandled)
- if RobloxHandled 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 every second frame, but only if the values changed
- --If player is not moving their mouse, client won't fire events
- local HB = game:GetService("RunService").Heartbeat
- while true 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
- --Wait 2 frames
- for i=1,2 do
- HB:Wait()
- end
- end]==],script)
- ----Sandboxed game object that allows the usage of client-side methods and services
- --Real game object
- local RealGame = game
- --Metatable for fake service
- local FakeService_Metatable = {
- __index = function(self,k)
- local s = rawget(self,"_RealService")
- if s then
- return typeof(s[k])=="function"
- and function(_,...)return s[k](s,...)end or s[k]
- end
- end,
- __newindex = function(self,k,v)
- local s = rawget(self,"_RealService")
- if s then s[k]=v end
- end
- }
- local function FakeService(t,RealService)
- t._RealService = typeof(RealService)=="string" and RealGame:GetService(RealService) or RealService
- return setmetatable(t,FakeService_Metatable)
- end
- --Fake game object
- local FakeGame = {
- GetService = function(self,s)
- return rawget(self,s) or RealGame:GetService(s)
- end,
- Players = FakeService({
- LocalPlayer = FakeService({GetMouse=function(self)return FakeMouse end},Player)
- },"Players"),
- UserInputService = FakeService(UIS,"UserInputService"),
- ContextActionService = FakeService(CAS,"ContextActionService"),
- RunService = FakeService({
- _btrs = {},
- RenderStepped = RealGame:GetService("RunService").Heartbeat,
- BindToRenderStep = function(self,name,_,fun)
- self._btrs[name] = self.Heartbeat:Connect(fun)
- end,
- UnbindFromRenderStep = function(self,name)
- self._btrs[name]:Disconnect()
- end,
- },"RunService")
- }
- rawset(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer)
- FakeGame.service = FakeGame.GetService
- FakeService(FakeGame,game)
- --Changing owner to fake player object to support owner:GetMouse()
- game,owner = FakeGame,FakeGame.Players.LocalPlayer
- end
- ---GUI By - Meow_Gang#8830 ---
- ---Script By - Cyclically#9215 ---
- --Credits to dhruvil123 (Same method but uses tools)--
- -- Objects
- local FeKill = Instance.new("ScreenGui")
- local Header = Instance.new("Frame")
- local Body = Instance.new("Frame")
- local Name = Instance.new("TextBox")
- local Kill = Instance.new("TextButton")
- local FEKill = Instance.new("TextLabel")
- local Exit = Instance.new("TextButton")
- local Minimize = Instance.new("TextButton")
- -- Properties
- FeKill.Name = "FeKill"
- FeKill.Parent = game.CoreGui
- FeKill.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- Header.Name = "Header"
- Header.Parent = FeKill
- Header.BackgroundColor3 = Color3.new(1, 0.180392, 0.180392)
- Header.BorderColor3 = Color3.new(1, 0.180392, 0.180392)
- Header.BorderSizePixel = 0
- Header.Position = UDim2.new(0.331454366, 0, 0.246315822, 0)
- Header.Size = UDim2.new(0, 191, 0, 20)
- Header.Active = true
- Header.Draggable = true
- Body.Name = "Body"
- Body.Parent = Header
- Body.BackgroundColor3 = Color3.new(0.317647, 0.317647, 0.317647)
- Body.BorderSizePixel = 0
- Body.Position = UDim2.new(-0.000720118987, 0, 0.998849511, 0)
- Body.Size = UDim2.new(0, 191, 0, 70)
- Name.Name = "Name"
- Name.Parent = Body
- Name.BackgroundColor3 = Color3.new(1, 1, 1)
- Name.BorderColor3 = Color3.new(0.243137, 0.0431373, 0.0431373)
- Name.BorderSizePixel = 3
- Name.Position = UDim2.new(0.125654474, 0, 0.099999994, 0)
- Name.Size = UDim2.new(0, 134, 0, 26)
- Name.Font = Enum.Font.SourceSans
- Name.Text = ""
- Name.TextColor3 = Color3.new(0, 0, 0)
- Name.TextSize = 14
- Kill.Name = "Kill"
- Kill.Parent = Body
- Kill.BackgroundColor3 = Color3.new(1, 1, 1)
- Kill.Position = UDim2.new(0.272251308, 0, 0.568443537, 0)
- Kill.Size = UDim2.new(0, 73, 0, 24)
- Kill.Style = Enum.ButtonStyle.RobloxRoundButton
- Kill.Font = Enum.Font.Arcade
- Kill.Text = "KILL"
- Kill.TextColor3 = Color3.new(0, 0, 0)
- Kill.TextSize = 14
- FEKill.Name = "FEKill"
- FEKill.Parent = Header
- FEKill.BackgroundColor3 = Color3.new(1, 1, 1)
- FEKill.BackgroundTransparency = 1
- FEKill.BorderSizePixel = 0
- FEKill.Position = UDim2.new(0.031413611, 0, 0, 0)
- FEKill.Size = UDim2.new(0, 46, 0, 16)
- FEKill.Font = Enum.Font.Arcade
- FEKill.Text = "FE KILL"
- FEKill.TextColor3 = Color3.new(0, 0, 0)
- FEKill.TextSize = 14
- FEKill.TextXAlignment = Enum.TextXAlignment.Left
- FEKill.TextYAlignment = Enum.TextYAlignment.Top
- Exit.Name = "Exit"
- Exit.Parent = Header
- Exit.BackgroundColor3 = Color3.new(1, 1, 1)
- Exit.Position = UDim2.new(0.879580975, 0, 0, 0)
- Exit.Size = UDim2.new(0, 23, 0, 20)
- Exit.Style = Enum.ButtonStyle.RobloxRoundButton
- Exit.Font = Enum.Font.Arcade
- Exit.Text = "X"
- Exit.TextColor3 = Color3.new(0, 0, 0)
- Exit.TextSize = 14
- Exit.MouseButton1Down:connect(function()
- FeKill:Destroy()
- end)
- Minimize.Name = "Minimize"
- Minimize.Parent = Header
- Minimize.BackgroundColor3 = Color3.new(1, 1, 1)
- Minimize.Position = UDim2.new(0.759162128, 0, -0.0500000007, 0)
- Minimize.Size = UDim2.new(0, 23, 0, 20)
- Minimize.Style = Enum.ButtonStyle.RobloxRoundButton
- Minimize.Font = Enum.Font.Arcade
- Minimize.Text = "-"
- Minimize.TextColor3 = Color3.new(0, 0, 0)
- Minimize.TextSize = 14
- Minimize.MouseButton1Down:connect(function()
- local Main = game.CoreGui.FeKill.Header.Body
- if Main.Visible == true then
- Main.Visible = false
- else
- Main.Visible = true
- end
- end)
- --kill--
- Kill.MouseButton1Down:connect(function()
- local targetname = Name.Text
- local LocalPlayer = game:GetService("Players").LocalPlayer
- local target = game:GetService("Players")[targetname]
- local torsoname = "Torso"
- if LocalPlayer.Character:FindFirstChild("Humanoid").RigType == Enum.HumanoidRigType.R15 then
- torsoname = "UpperTorso"
- end
- if target.Character ~= nil then
- local savepos = LocalPlayer.Character:FindFirstChild("HumanoidRootPart").CFrame
- LocalPlayer.Character:FindFirstChild(torsoname).Anchored = true
- local tool = Instance.new("Tool", LocalPlayer.Backpack)
- local hat = LocalPlayer.Character:FindFirstChildOfClass("Accessory")
- local hathandle = hat.Handle
- hathandle.Parent = tool
- hathandle.Massless = true
- tool.GripPos = Vector3.new(0, 9e99, 0)
- tool.Parent = LocalPlayer.Character
- repeat wait() until LocalPlayer.Character:FindFirstChildOfClass("Tool") ~= nil
- tool.Grip = CFrame.new(Vector3.new(0, 0, 0))
- LocalPlayer.Character:FindFirstChild(torsoname).Anchored = false
- repeat
- LocalPlayer.Character:FindFirstChild("HumanoidRootPart").CFrame = target.Character:FindFirstChild("HumanoidRootPart").CFrame
- wait()
- until target.Character == nil or target.Character:FindFirstChild("Humanoid").Health <= 0 or LocalPlayer.Character == nil or LocalPlayer.Character:FindFirstChild("Humanoid").Health <= 0 or (target.Character:FindFirstChild("HumanoidRootPart").Velocity.magnitude - target.Character:FindFirstChild("Humanoid").WalkSpeed) > (target.Character:FindFirstChild("Humanoid").WalkSpeed + 20)
- LocalPlayer.Character:FindFirstChild("Humanoid"):UnequipTools()
- hathandle.Parent = hat
- hathandle.Massless = false
- tool:Destroy()
- LocalPlayer.Character:FindFirstChild("HumanoidRootPart").CFrame = savepos
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement