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
- corl = owner
- mouse = corl:GetMouse()
- char = corl.Character
- mas = char
- mas2 = char.Head
- Figure = char
- local head = char:WaitForChild("Head")
- local Torso = char:WaitForChild("Torso")
- local LArm = char:WaitForChild("Left Arm")
- local RArm = char:WaitForChild("Right Arm")
- local LLeg = char:WaitForChild("Left Leg")
- local RLeg = char:WaitForChild("Right Leg")
- local humanoid = char:WaitForChild("Humanoid")
- local rootpart = char:WaitForChild("HumanoidRootPart")
- for i,v in pairs(char:GetChildren()) do
- if v.ClassName == "Accessory" then
- v:remove()
- v.Parent = nil
- v:Destroy()
- end
- end
- local p = char.Torso.CFrame
- BODYCOLORS = char:WaitForChild("Body Colors")
- BODYCOLORS.HeadColor = BrickColor.new("Light orange")
- BODYCOLORS.TorsoColor = BrickColor.new("Light orange")
- BODYCOLORS.LeftArmColor = BrickColor.new("Light orange")
- BODYCOLORS.LeftLegColor = BrickColor.new("Light orange")
- BODYCOLORS.RightArmColor = BrickColor.new("Light orange")
- BODYCOLORS.RightLegColor = BrickColor.new("Light orange")
- for i,v in pairs(char.Head:GetChildren()) do
- if v.ClassName == "Decal" then
- v:remove()
- v.Parent = nil
- v:Destroy()
- end
- end
- for i,v in pairs(char:GetChildren()) do
- if v.ClassName == "CharacterMesh" then
- v:remove()
- v.Parent = nil
- v:Destroy()
- end
- end
- for i,v in pairs(char:GetChildren()) do
- if v.ClassName == "Shirt" then
- v:remove()
- v.Parent = nil
- v:Destroy()
- end
- end
- for i,v in pairs(char:GetChildren()) do
- if v.ClassName == "Pants" then
- v:remove()
- v.Parent = nil
- v:Destroy()
- end
- end
- for i,v in pairs(char.Head:GetChildren()) do
- v.Parent = nil
- end
- Model0 = char
- CharacterMesh1 = Instance.new("CharacterMesh")
- CharacterMesh2 = Instance.new("CharacterMesh")
- CharacterMesh3 = Instance.new("CharacterMesh")
- CharacterMesh4 = Instance.new("CharacterMesh")
- CharacterMesh5 = Instance.new("CharacterMesh")
- BodyColors6 = Instance.new("BodyColors")
- Shirt7 = Instance.new("Shirt")
- Pants8 = Instance.new("Pants")
- Accessory9 = Instance.new("Accessory")
- Part10 = Instance.new("Part")
- SpecialMesh11 = Instance.new("SpecialMesh")
- Vector3Value12 = Instance.new("Vector3Value")
- Camera13 = Instance.new("Camera")
- CharacterMesh1.Name = "Silver Robot Torso"
- CharacterMesh1.Parent = Model0
- CharacterMesh1.BodyPart = Enum.BodyPart.Torso
- CharacterMesh1.MeshId = 136796198
- CharacterMesh1.OverlayTextureId = 136795997
- CharacterMesh2.Name = "Silver Robot Right Leg"
- CharacterMesh2.Parent = Model0
- CharacterMesh2.BodyPart = Enum.BodyPart.RightLeg
- CharacterMesh2.MeshId = 136796184
- CharacterMesh2.OverlayTextureId = 136795997
- CharacterMesh3.Name = "Silver Robot Left Leg"
- CharacterMesh3.Parent = Model0
- CharacterMesh3.BodyPart = Enum.BodyPart.LeftLeg
- CharacterMesh3.MeshId = 136796146
- CharacterMesh3.OverlayTextureId = 136795997
- CharacterMesh4.Name = "Silver Robot Right Arm"
- CharacterMesh4.Parent = Model0
- CharacterMesh4.BodyPart = Enum.BodyPart.RightArm
- CharacterMesh4.MeshId = 136796166
- CharacterMesh4.OverlayTextureId = 136795997
- CharacterMesh5.Name = "Silver Robot Left Arm"
- CharacterMesh5.Parent = Model0
- CharacterMesh5.BodyPart = Enum.BodyPart.LeftArm
- CharacterMesh5.MeshId = 136796079
- CharacterMesh5.OverlayTextureId = 136795997
- BodyColors6.Parent = Model0
- BodyColors6.HeadColor = BrickColor.new("Lilac")
- BodyColors6.HeadColor3 = Color3.new(0.654902, 0.368627, 0.607843)
- BodyColors6.LeftArmColor = BrickColor.new("Lilac")
- BodyColors6.LeftArmColor3 = Color3.new(0.654902, 0.368627, 0.607843)
- BodyColors6.LeftLegColor = BrickColor.new("Lilac")
- BodyColors6.LeftLegColor3 = Color3.new(0.654902, 0.368627, 0.607843)
- BodyColors6.RightArmColor = BrickColor.new("Lilac")
- BodyColors6.RightArmColor3 = Color3.new(0.654902, 0.368627, 0.607843)
- BodyColors6.RightLegColor = BrickColor.new("Lilac")
- BodyColors6.RightLegColor3 = Color3.new(0.654902, 0.368627, 0.607843)
- BodyColors6.TorsoColor = BrickColor.new("Lilac")
- BodyColors6.TorsoColor3 = Color3.new(0.654902, 0.368627, 0.607843)
- Shirt7.Name = "Shirt"
- Shirt7.Parent = Model0
- Shirt7.ShirtTemplate = "http://www.roblox.com/asset/?id=855776101"
- Pants8.Name = "Pants"
- Pants8.Parent = Model0
- Pants8.PantsTemplate = "http://www.roblox.com/asset/?id=867813066"
- Accessory9.Name = "EgyptianMask"
- Accessory9.Parent = Model0
- Accessory9.AttachmentPoint = CFrame.new(0, 0.600000024, 0.25, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Accessory9.AttachmentPos = Vector3.new(0, 0.600000024, 0.25)
- Part10.Name = "Handle"
- Part10.Parent = Accessory9
- Part10.CFrame = CFrame.new(63.4999886, 9.5950222, 128.450256, 1, -7.87137555e-09, 0, 7.87137555e-09, 1, 4.1444221e-16, -3.26223034e-24, -4.1444221e-16, 1)
- Part10.Position = Vector3.new(63.4999886, 9.5950222, 128.450256)
- Part10.Size = Vector3.new(1.52002668, 1.58999789, 1.80000269)
- Part10.BottomSurface = Enum.SurfaceType.Smooth
- Part10.CanCollide = false
- Part10.Locked = true
- Part10.TopSurface = Enum.SurfaceType.Smooth
- Part10.FormFactor = Enum.FormFactor.Custom
- Part10.formFactor = Enum.FormFactor.Custom
- SpecialMesh11.Parent = Part10
- SpecialMesh11.MeshId = "http://www.roblox.com/asset/?id=177442491 "
- SpecialMesh11.Scale = Vector3.new(1.20000005, 1.20000005, 1.20000005)
- SpecialMesh11.TextureId = "http://www.roblox.com/asset/?id=177442555 "
- SpecialMesh11.MeshType = Enum.MeshType.FileMesh
- Vector3Value12.Name = "OriginalSize"
- Vector3Value12.Parent = Part10
- Vector3Value12.Value = Vector3.new(1.52002668, 1.58999789, 1.80000269)
- Camera13.Name = "ThumbnailCamera"
- Camera13.Parent = Accessory9
- Camera13.CFrame = CFrame.new(-1.26414585, 0.574665964, -8.09290791, -0.961262107, 0.0457770824, -0.271807969, 3.72528985e-09, 0.986112595, 0.16607812, 0.275635809, 0.159644604, -0.947912753)
- Camera13.CoordinateFrame = CFrame.new(-1.26414585, 0.574665964, -8.09290791, -0.961262107, 0.0457770824, -0.271807969, 3.72528985e-09, 0.986112595, 0.16607812, 0.275635809, 0.159644604, -0.947912753)
- Camera13.Focus = CFrame.new(-0.339998245, 0.0100000501, -4.87000275, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Camera13.focus = CFrame.new(-0.339998245, 0.0100000501, -4.87000275, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- SpecialMesh0 = Instance.new("SpecialMesh")
- Decal1 = Instance.new("Decal")
- SpecialMesh0.Parent = char.Head
- SpecialMesh0.Scale = Vector3.new(1.25, 1.25, 1.25)
- Decal1.Name = "face"
- Decal1.Parent = char.Head
- Decal1.Texture = "rbxasset://textures/face.png"
- char.Torso.CFrame = p
Add Comment
Please, Sign In to add comment