Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Instructions:
- --[[
- Any local variables with :
- = LocalPlayer:
- Must be replaced with "owner". So if your local variable is game.Players.LocalPlayer , replace it with owner
- = :GetMouse():
- Remove the variable entirely.
- then paste this over the desired script
- --]]
- if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
- local Player,Mouse,mouse,UserInputService,ContextActionService = owner
- do
- print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
- script.Parent = Player.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,Connect=function(self,f)self.Function=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 and t.Function then
- t.Function(...)
- end
- end
- m.TrigEvent = te
- UIS.TrigEvent = te
- Event.OnServerEvent:Connect(function(plr,io)
- if plr~=Player then return end
- if io.isMouse then
- m.Target = io.Target
- m.Hit = io.Hit
- else
- 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 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})
- end
- UIS.InputBegan:Connect(input)
- UIS.InputEnded:Connect(input)
- local Mouse = Player:GetMouse()
- 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)
- Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
- end
- -- End of FE converter
- local char = owner.Character
- function weldi(part1,part2)
- local weld0 = Instance.new("WeldConstraint",part1)
- weld0.Part0 = part1
- weld0.Part1 = part2
- end
- if char then
- wait(1)
- local CCC = char:GetChildren()
- TorsoIsTrue = "Part"
- TorsoID = nil
- for _, v in pairs(CCC) do
- if v:IsA("CharacterMesh") then
- if v.MeshId==48112070 then
- TorsoIsTrue = "FE"
- TorsoID = v.MeshId
- end
- end
- end
- if TorsoIsTrue=="FE" then
- local part_1 = Instance.new("Part",char)
- part_1.CFrame = char.Torso.CFrame* CFrame.new(0,.75,0)
- part_1.CanCollide = false
- weldi(char.Torso,part_1)
- part_1.BrickColor = BrickColor.new("Really Black")
- part_1.Material = Enum.Material.Fabric
- part_1.Size = Vector3.new(2.05,.55,1.05)
- local part_2 = Instance.new("WedgePart",char)
- part_2.CFrame = char.Torso.CFrame* CFrame.new(-.771,-.25,0)
- part_2.Orientation =char.Torso.Orientation + Vector3.new(90,0,90)
- part_2.CanCollide = false
- weldi(char.Torso,part_2)
- part_2.BrickColor = BrickColor.new("Really Black")
- part_2.Material = Enum.Material.Fabric
- part_2.Size = Vector3.new(1, 0.55, 1.65)
- local part_3 = Instance.new("WedgePart",char)
- part_3.CFrame = char.Torso.CFrame* CFrame.new(-.75,-.25,0)
- part_3.Orientation =char.Torso.Orientation + Vector3.new(-90,0,90)
- part_3.CanCollide = false
- weldi(char.Torso,part_3)
- part_3.BrickColor = BrickColor.new("Really Black")
- part_3.Material = Enum.Material.Fabric
- part_3.Size = Vector3.new(1, 0.55, 1.65)
- local part_4 = Instance.new("WedgePart",char)
- part_4.CFrame = char.Torso.CFrame* CFrame.new(.75,-.25,0)
- part_4.Orientation =char.Torso.Orientation + Vector3.new(-90,180,90)
- part_4.CanCollide = false
- weldi(char.Torso,part_4)
- part_4.BrickColor = BrickColor.new("Really Black")
- part_4.Material = Enum.Material.Fabric
- part_4.Size = Vector3.new(1, 0.55, 1.65)
- local part_5 = Instance.new("WedgePart",char)
- part_5.CFrame = char.Torso.CFrame* CFrame.new(.77,-.25,0)
- part_5.Orientation =char.Torso.Orientation + Vector3.new(90,180,90)
- part_5.CanCollide = false
- weldi(char.Torso,part_5)
- part_5.BrickColor = BrickColor.new("Really Black")
- part_5.Material = Enum.Material.Fabric
- part_5.Size = Vector3.new(1, 0.55, 1.65)
- local part_6 = Instance.new("Part",char)
- part_6.CFrame = char.Torso.CFrame* CFrame.new(0,-.25,0)
- part_6.CanCollide = false
- weldi(char.Torso,part_6)
- part_6.BrickColor = BrickColor.new("Really Black")
- part_6.Material = Enum.Material.Fabric
- part_6.Size = Vector3.new(1, 1.6, 1)
- else
- local part1 = Instance.new("Part",char)
- part1.CFrame = char.Torso.CFrame
- part1.CanCollide = false
- weldi(char.Torso,part1)
- part1.BrickColor = BrickColor.new("Really Black")
- part1.Material = Enum.Material.Fabric
- part1.Size = Vector3.new(char.Torso.Size.X*1.05,char.Torso.Size.Y*1.05,char.Torso.Size.Z*1.05)
- end
- part2 = Instance.new("Part",char)
- part2.CFrame = char["Left Arm"].CFrame *CFrame.new(0,.1,0)
- part2.CanCollide = false
- weldi(char["Left Arm"],part2)
- part2.BrickColor = BrickColor.new("Really Black")
- part2.Material = Enum.Material.Fabric
- part2.Size = Vector3.new(char["Left Arm"].Size.X*1.05,char["Left Arm"].Size.Y*.95,char["Left Arm"].Size.Z*1.05)
- part3 = Instance.new("Part",char)
- part3.CFrame = char["Right Arm"].CFrame*CFrame.new(0,.1,0)
- part3.CanCollide = false
- weldi(char["Right Arm"],part3)
- part3.BrickColor = BrickColor.new("Really Black")
- part3.Material = Enum.Material.Fabric
- part3.Size = Vector3.new(char["Right Arm"].Size.X*1.05,char["Right Arm"].Size.Y*.95,char["Right Arm"].Size.Z*1.05)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement