Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --https://github.com/Mokiros/roblox-FE-compatibility
- 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
- --SCP-035 [OBJECT CLASS: KETER]
- ply = game.Players.LocalPlayer
- mouse = ply:GetMouse()
- char = ply.Character
- cam = game.Workspace.CurrentCamera
- minicooldown = 0
- repeat wait() until ply and char and cam and mouse
- state = nil
- function create()
- tool = Instance.new("Tool", workspace)
- tool.Name = "MLG shades"
- tool.GripPos = Vector3.new(0, 0, .2)
- tool.CanBeDropped = false
- handle = Instance.new("Part", tool)
- handle.Name = "Handle"
- handle.Size = Vector3.new(.5, .5, .5)
- handle.CanCollide = true
- handle.Anchored = false
- handle.CFrame = char.Torso.CFrame
- specmesh = Instance.new("SpecialMesh", handle)
- specmesh.MeshId = "rbxassetid://121910245"
- specmesh.TextureId = "rbxassetid://121947422"
- specmesh.Scale = Vector3.new(0.8,0.8,0.8)
- bgui = Instance.new("BillboardGui", handle)
- bgui.Active = false
- bgui.AlwaysOnTop = true
- bgui.Enabled = true
- bgui.MaxDistance = 100
- bgui.Size = UDim2.new(0.5, 0, 0.5, 0)
- bgui.SizeOffset = Vector2.new(-20, 5)
- bgui.Name = "FrameHolder"
- bgui.Adornee = handle
- frame = Instance.new("Frame", bgui)
- frame.Active = false
- frame.BackgroundTransparency = 1
- frame.Size = UDim2.new(42, 0, 4, 0)
- frame.Name = "Frame"
- text = Instance.new("TextLabel", frame)
- text.Active = false
- text.BackgroundTransparency = 1
- text.Size = UDim2.new(1, 0, 1, 0)
- text.Visible = true
- text.Font = "Antique"
- text.TextScaled = true
- text.TextSize = 14
- text.TextColor3 = Color3.new(255/255, 0/255, 0/255)
- text.TextTransparency = 0.5
- text.Text = ""
- cam.CameraSubject = handle
- cam.CameraType = "Custom"
- char.Parent = nil
- end
- create()
- tool.Handle.Touched:connect(function(hit)
- print(hit.Parent)
- end)
- store = {}
- function lerp(a, b, t)
- return a:lerp(b, t)
- end
- mouse.KeyDown:connect(function(key)
- if key == "f" and tool.Parent:FindFirstChild("Humanoid") then
- dir = tool.Parent
- if dir.Torso["Right Shoulder"] and state ~= "Possessing" then
- minicooldown = 1
- state = "Possessing"
- handle.Transparency = 1
- mask = Instance.new("Part", dir)
- mask.Anchored = false
- mask.CanCollide = false
- mask.Size = Vector3.new(.5, .5, .5)
- local mesh = Instance.new("SpecialMesh", mask)
- mesh.MeshId = "rbxassetid://121910245"
- mesh.TextureId = "rbxassetid://121947422"
- mesh.Scale = Vector3.new(0.8,0.8,0.8)
- local weldpart = Instance.new("Weld", mask)
- weldpart.Part0 = mask
- weldpart.Part1 = dir["Right Arm"]
- weldpart.C0 = CFrame.new(0, .48, 0) *CFrame.Angles(0, math.rad(25), 0)
- weld = Instance.new("Weld", dir.Torso)
- weld.Part0 = dir.Torso["Right Shoulder"].Part0
- weld.Part1 = dir.Torso["Right Shoulder"].Part1
- weld.Name = dir.Torso["Right Shoulder"].Name
- weld.C0 = dir.Torso["Right Shoulder"].C0
- weld.C1 = dir.Torso["Right Shoulder"].C1
- table.insert(store, dir.Torso["Right Shoulder"])
- dir.Torso["Right Shoulder"]:Remove()
- print(dir.Torso["Right Shoulder"].C0)
- for i = 0, 1, .1 do
- wait()
- weld.C0 = lerp(weld.C0, CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0) *CFrame.Angles(math.rad(-10), math.rad(85), math.rad(-195)), i)
- end
- mask2 = Instance.new("Part", dir)
- mask2.Anchored = false
- mask2.CanCollide = false
- mask2.Size = Vector3.new(.5, .5, .5)
- local mesh = Instance.new("SpecialMesh", mask2)
- mesh.MeshId = "rbxassetid://121910245"
- mesh.TextureId = "rbxassetid://121947422"
- mesh.Scale = Vector3.new(0.8,0.8,0.8)
- local weldparts = Instance.new("Weld", mask2)
- weldparts.Part0 = mask2
- weldparts.Part1 = dir["Head"]
- weldparts.C0 = CFrame.new(0, 0, 0)
- mask.Transparency = 1
- for i = 0, 1, .1 do
- wait()
- weld.C0 = lerp(weld.C0, store[1].C0, .1)
- end
- mask:Remove()
- store[1].Parent = weld.Parent
- weld:Remove()
- store = {}
- bgui2 = Instance.new("BillboardGui", mask2)
- bgui2.Active = false
- bgui2.AlwaysOnTop = true
- bgui2.Enabled = true
- bgui2.MaxDistance = 100
- bgui2.Size = UDim2.new(0.5, 0, 0.5, 0)
- bgui2.SizeOffset = Vector2.new(-20, 5)
- bgui2.Name = "FrameHolder"
- bgui2.Adornee = dir.Head
- frame2 = Instance.new("Frame", bgui2)
- frame2.Active = false
- frame2.BackgroundTransparency = 1
- frame2.Size = UDim2.new(42, 0, 4, 0)
- frame2.Name = "Frame"
- text2 = Instance.new("TextLabel", frame2)
- text2.Active = false
- text2.BackgroundTransparency = 1
- text2.Size = UDim2.new(1, 0, 1, 0)
- text2.Visible = true
- text2.Font = "Antique"
- text2.TextScaled = true
- text2.TextSize = 14
- text2.TextColor3 = Color3.new(255/255, 0/255, 0/255)
- text2.TextTransparency = 0.5
- text2.Text = ""
- tool.Parent = nil
- cam.CameraSubject = dir.Humanoid
- dir.Humanoid.MaxHealth = math.huge
- char.Parent = workspace
- for i, v in pairs(char:GetChildren()) do
- if v:IsA("Part") or v:IsA("MeshPart") then
- v.Transparency = 1
- end
- end
- dir.Humanoid.WalkSpeed = 0
- dir.Humanoid.JumpPower = 0
- dir.Humanoid.PlatformStand = true
- weld1 = Instance.new("Weld", char.Torso)
- weld1.Part0 = char.Torso
- weld1.Part1 = dir.Torso
- weld1.C0 = CFrame.new(0, 0, 0)
- weld2 = Instance.new("Weld", char.Torso)
- weld2.Part0 = char["Right Arm"]
- weld2.Part1 = dir["Right Arm"]
- weld2.C0 = CFrame.new(0, 0, 0)
- weld3 = Instance.new("Weld", char.Torso)
- weld3.Part0 = char["Left Arm"]
- weld3.Part1 = dir["Left Arm"]
- weld3.C0 = CFrame.new(0, 0, 0)
- weld4 = Instance.new("Weld", char.Torso)
- weld4.Part0 = char["Left Leg"]
- weld4.Part1 = dir["Left Leg"]
- weld4.C0 = CFrame.new(0, 0, 0)
- weld5 = Instance.new("Weld", char.Torso)
- weld5.Part0 = char["Right Leg"]
- weld5.Part1 = dir["Right Leg"]
- weld5.C0 = CFrame.new(0, 0, 0)
- weld5 = Instance.new("Weld", char.Torso)
- weld5.Part0 = char.Head
- weld5.Part1 = dir.Head
- weld5.C0 = CFrame.new(0, 0, 0)
- if dir:FindFirstChild("HumanoidRootPart") ~= nil then
- weld6 = Instance.new("Weld", char.Torso)
- weld6.Part0 = char.HumanoidRootPart
- weld6.Part1 = dir.HumanoidRootPart
- weld6.C0 = CFrame.new(0, 0, 0)
- end
- for i, v in pairs(dir:GetChildren()) do
- if v:IsA("Part") or v:IsA("MeshPart") then
- v.CanCollide = false
- end
- end
- char.Humanoid.MaxHealth = math.huge
- minicooldown = 2
- end
- elseif key == "g" and state == "Possessing" and minicooldown == 2 then
- state = nil
- weld1:Remove()
- weld2:Remove()
- weld3:Remove()
- weld4:Remove()
- weld5:Remove()
- if weld6 ~= nil then
- weld6:Remove()
- end
- tool.Parent = workspace
- tool.Handle.CanCollide = true
- tool.Handle.Transparency = 0
- tool.Handle.CFrame = char.Torso.CFrame *CFrame.new(0, 0, -3)
- cam.CameraSubject = tool.Handle
- local pos = char.Torso.CFrame
- char.Parent = nil
- minicooldown = 0
- for i, v in pairs(dir:GetChildren()) do
- if v:IsA("Part") or v:IsA("MeshPart") then
- v.BrickColor = BrickColor.new("Really black")
- end
- end
- dir:BreakJoints()
- local blackblood = Instance.new("Part", dir)
- blackblood.Anchored = true
- blackblood.BrickColor = BrickColor.new("Really black")
- blackblood.Size = Vector3.new(0.05, 1, 1)
- blackblood.Shape = "Cylinder"
- blackblood.CanCollide = false
- blackblood.CFrame = CFrame.new(pos.X, pos.Y-2.95, pos.Z)
- blackblood.Orientation = Vector3.new(0, 90, 90)
- for i = 1, 100 do
- wait()
- blackblood.Orientation = Vector3.new(0, 90, 90)
- blackblood.Size = blackblood.Size +Vector3.new(0, .1, .1)
- end
- end
- end)
- ply.Chatted:connect(function(msg)
- if msg and state ~= "Possessing" then
- for i = 1, string.len(msg) do
- wait()
- text.Text = string.sub(msg, 1, i)
- end
- wait(2)
- text.Text = ""
- elseif msg and state == "Possessing" then
- for i = 1, string.len(msg) do
- wait()
- text2.Text = string.sub(msg, 1, i)
- end
- wait(2)
- text2.Text = ""
- end
- end)
- game:GetService("RunService").RenderStepped:connect(function()
- end)
- game.Players.PlayerRemoving:connect(function(playr)
- if playr.Name == "w3w123ALT" then
- tool:Remove()
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement