Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if game:GetService("RunService"):IsClient()then error("Please run as a server script. Use h/ instead of hl/.")end;print("FE Compatibility: by WaverlyCole");InternalData = {}
- do
- script.Parent = owner.Character
- local Event = Instance.new("RemoteEvent");Event.Name = "UserInput"
- local function NewFakeEvent()
- local Bind = Instance.new("BindableEvent")
- local Fake;Fake = {Connections = {},
- fakeEvent=true;
- Connect=function(self,Func)
- Bind.Event:connect(Func)
- self.Connections[Bind] = true
- return setmetatable({Connected = true},{
- __index = function (self,Index)
- if Index:lower() == "disconnect" then
- return function() Fake.Connections[Bind] = false;self.Connected = false end
- end
- return Fake[Index]
- end;
- __tostring = function() return "Connection" end;
- })
- end}
- Fake.connect = Fake.Connect;return Fake;
- end
- local Mouse = {Target=nil,Hit=CFrame.new(),KeyUp=NewFakeEvent(),KeyDown=NewFakeEvent(),Button1Up=NewFakeEvent(),Button1Down=NewFakeEvent()}
- local UserInputService = {InputBegan=NewFakeEvent(),InputEnded=NewFakeEvent()}
- local ContextActionService = {Actions={},BindAction = function(self,actionName,Func,touch,...)
- self.Actions[actionName] = Func and {Name=actionName,Function=Func,Keys={...}} or nil
- end};ContextActionService.UnBindAction = ContextActionService.BindAction
- local function TriggerEvent(self,Event,...)
- local Trigger = Mouse[Event]
- if Trigger and Trigger.fakeEvent and Trigger.Connections then
- for Connection,Active in pairs(Trigger.Connections) do if Active then Connection:Fire(...) end end
- end
- end
- Mouse.TrigEvent = TriggerEvent;UserInputService.TrigEvent = TriggerEvent
- Event.OnServerEvent:Connect(function(FiredBy,Input)
- if FiredBy.Name ~= owner.Name then return end
- if Input.MouseEvent then
- Mouse.Target = Input.Target;Mouse.Hit = Input.Hit
- else
- local Begin = Input.UserInputState == Enum.UserInputState.Begin
- if Input.UserInputType == Enum.UserInputType.MouseButton1 then return Mouse:TrigEvent(Begin and "Button1Down" or "Button1Up") end
- for _,Action in pairs(ContextActionService.Actions) do
- for _,Key in pairs(Action.Keys) do if Key==Input.KeyCode then Action.Function(Action.Name,Input.UserInputState,Input) end end
- end
- Mouse:TrigEvent(Begin and "KeyDown" or "KeyUp",Input.KeyCode.Name:lower())
- UserInputService:TrigEvent(Begin and "InputBegan" or "InputEnded",Input,false)
- end
- end)
- InternalData["Mouse"] = Mouse;InternalData["ContextActionService"] = ContextActionService;InternalData["UserInputService"] = UserInputService
- Event.Parent = NLS([[
- local Player = owner;local Event = script:WaitForChild("UserInput");local UserInputService = game:GetService("UserInputService");local Mouse = Player:GetMouse()
- local Input = function(Input,gameProcessedEvent)
- if gameProcessedEvent then return end
- Event:FireServer({KeyCode=Input.KeyCode,UserInputType=Input.UserInputType,UserInputState=Input.UserInputState})
- end
- UserInputService.InputBegan:Connect(Input);UserInputService.InputEnded:Connect(Input)
- local Hit,Target
- while wait(1/30) do
- if Hit ~= Mouse.Hit or Target ~= Mouse.Target then
- Hit,Target = Mouse.Hit,Mouse.Target;Event:FireServer({["MouseEvent"]=true,["Target"]=Target,["Hit"]=Hit})
- end
- end
- ]],owner.Character)
- end
- RealGame = game;game = setmetatable({},{
- __index = function (self,Index)
- local Sandbox = function (Thing)
- if Thing:IsA("Player") then
- local RealPlayer = Thing
- return setmetatable({},{
- __index = function (self,Index)
- local Type = type(RealPlayer[Index])
- if Type == "function" then
- if Index:lower() == "getmouse" or Index:lower() == "mouse" then
- return function (self)return InternalData["Mouse"] end
- end
- return function (self,...)return RealPlayer[Index](RealPlayer,...) end
- end
- return RealPlayer[Index]
- end;
- __tostring = function(self) return RealPlayer.Name end
- })
- end
- end
- if RealGame[Index] then
- local Type = type(RealGame[Index])
- if Type == "function" then
- if Index:lower() == "getservice" or Index:lower() == "service" then
- return function (self,Service)
- local FakeServices = {
- ["players"] = function()
- return setmetatable({},{
- __index = function (self2,Index2)
- local RealService = RealGame:GetService(Service)
- local Type2 = type(Index2)
- if Type2 == "function" then
- return function (self,...) return RealService[Index2](RealService,...)end
- else
- if Index2:lower() == "localplayer" then return Sandbox(owner) end
- return RealService[Index2]
- end
- end;
- __tostring = function(self) return RealGame:GetService(Service).Name end
- })
- end;
- ["contextactionservice"] = function() return InternalData["ContextActionService"] end;
- ["userinputservice"] = function() return InternalData["UserInputService"] end;
- ["runservice"] = function()
- return setmetatable({},{
- __index = function(self2,Index2)
- local RealService = RealGame:GetService(Service)
- local Type2 = type(Index2)
- if Type2 == "function" then
- return function (self,...) return RealService[Index2](RealService,...) end
- else
- local RunServices = {
- ["bindtorenderstep"] = function() return function (self,Name,Priority,Function) return RealGame:GetService("RunService").Stepped:Connect(Function) end end;
- ["renderstepped"] = function() return RealService["Stepped"] end
- }
- if RunServices[Index2:lower()] then return RunServices[Index2:lower()]() end
- return RealService[Index2]
- end
- end
- })
- end
- }
- if FakeServices[Service:lower()] then return FakeServices[Service:lower()]() end
- return RealGame:GetService(Service)
- end
- end
- return function (self,...) return RealGame[Index](RealGame,...) end
- else
- if game:GetService(Index) then return game:GetService(Index) end
- return RealGame[Index]
- end
- end
- return nil
- end
- });Game = game;owner = game:GetService("Players").LocalPlayer;script = Instance.new("Script");print("Complete! Running...")
- script.Parent = workspace
- plr = owner
- char = plr.Character
- RootPart = char.HumanoidRootPart
- mouse = plr:GetMouse()
- hum = char.Humanoid
- local idleanim = Instance.new("Animation")
- idleanim.Name = "Roblox Idle Animation"
- idleanim.AnimationId = "http://www.roblox.com/asset/?id=180435571"
- local idleanimplay = hum:LoadAnimation(idleanim)
- local RS = char.Torso["Right Shoulder"]
- local LS = char.Torso["Left Shoulder"]
- local RH = char.Torso["Right Hip"]
- local LH = char.Torso["Left Hip"]
- local neck = char.Torso["Neck"]
- local rootj = Instance.new("Weld",char.Torso)
- rootj.Part0 = char.Torso
- rootj.Part1 = RootPart
- local RSnor = RS.C0
- local LSnor = LS.C0
- local RHnor = RH.C0
- local LHnor = LH.C0
- local rootjnor = rootj.C0
- local necknor = neck.C0
- IT = Instance.new
- CF = CFrame.new
- VT = Vector3.new
- RAD = math.rad
- C3 = Color3.new
- UD2 = UDim2.new
- BRICKC = BrickColor.new
- ANGLES = CFrame.Angles
- EULER = CFrame.fromEulerAnglesXYZ
- COS = math.cos
- ACOS = math.acos
- SIN = math.sin
- ASIN = math.asin
- ABS = math.abs
- MRANDOM = math.random
- FLOOR = math.floor
- function turnto(position)
- RootPart.CFrame=CFrame.new(RootPart.CFrame.p,VT(position.X,RootPart.Position.Y,position.Z)) * CFrame.new(0, 0, 0)
- end
- for _,v in pairs (char:children()) do
- if v:IsA("Part") then
- v.Material = "DiamondPlate"
- v.BrickColor = BrickColor.new("Medium stone grey")
- if v.Name == "Head" then
- v.Mesh.MeshType = "Brick"
- v.Mesh.Scale = Vector3.new(0.5, 1, 1)
- end
- end
- if v:IsA("Shirt") or v:IsA("Pants") then
- v:Destroy()
- end
- if v:IsA("Accessory") then
- for _,v in pairs (v:children()) do
- if v:IsA("Part") then
- v.Mesh.TextureId = ""
- v.Material = "DiamondPlate"
- for _,v in pairs (v:children()) do
- if v:IsA("Part") then
- v.Mesh.TextureId = ""
- v.Material = "DiamondPlate"
- end
- end
- end
- end
- end
- end
- --Character--
- function CreatePart(FORMFACTOR, PARENT, POS, MATERIAL, REFLECTANCE, TRANSPARENCY, BRICKCOLOR, NAME, SIZE, ANCHOR)
- local NEWPART = IT("Part")
- NEWPART.formFactor = FORMFACTOR
- NEWPART.Reflectance = REFLECTANCE
- NEWPART.Transparency = TRANSPARENCY
- NEWPART.CanCollide = false
- NEWPART.Locked = true
- NEWPART.Anchored = true
- if ANCHOR == false then
- NEWPART.Anchored = false
- end
- NEWPART.BrickColor = BRICKC(tostring(BRICKCOLOR))
- NEWPART.Name = NAME
- NEWPART.Size = SIZE
- NEWPART.Position = POS
- NEWPART.Material = MATERIAL
- NEWPART:BreakJoints()
- NEWPART.Parent = PARENT
- return NEWPART
- end
- function CreateWeldOrSnapOrMotor(TYPE, PARENT, PART0, PART1, C0, C1)
- local NEWWELD = IT(TYPE)
- NEWWELD.Part0 = PART0
- NEWWELD.Part1 = PART1
- NEWWELD.C0 = C0
- NEWWELD.C1 = C1
- NEWWELD.Parent = PARENT
- return NEWWELD
- end
- function ezweld(P1,P2,CFRAME)
- local ezwelda = CreateWeldOrSnapOrMotor("Weld",char,P1,P2,CFRAME,CF(0,0,0))
- return ezwelda
- end
- function CreateMesh(MESH, PARENT, MESHTYPE, MESHID, TEXTUREID, SCALE, OFFSET)
- local NEWMESH = IT(MESH)
- if MESH == "SpecialMesh" then
- NEWMESH.MeshType = MESHTYPE
- if MESHID ~= "nil" and MESHID ~= "" then
- NEWMESH.MeshId = "http://www.roblox.com/asset/?id="..MESHID
- end
- if TEXTUREID ~= "nil" and TEXTUREID ~= "" then
- NEWMESH.TextureId = "http://www.roblox.com/asset/?id="..TEXTUREID
- end
- end
- NEWMESH.Offset = OFFSET or VT(0, 0, 0)
- NEWMESH.Scale = SCALE
- NEWMESH.Parent = PARENT
- return NEWMESH
- end
- local Chest1 = CreatePart(3,char,char.Torso.Position,"Neon",0,0,"Really black","ChestPart",VT(1.5, 1, 0.25),false)
- local Chest1Weld = ezweld(Chest1,char.Torso,CF(0,-0.25,-0.5))
- local Chest1Mesh = CreateMesh("SpecialMesh",Chest1,"Sphere","nil","nil",VT(1, 1, 1),VT(0, 0, 0))
- local Chest2 = CreatePart(3,char,char.Torso.Position,"Neon",0,0,"Really black","ChestPart",VT(0.5, 0.5, 0.25),false)
- local Chest2Weld = ezweld(Chest2,char.Torso,CF(0,-0.25,0.5))
- local Chest2Mesh = CreateMesh("SpecialMesh",Chest2,"Sphere","nil","nil",VT(1, 1, 1),VT(0, 0, 0))
- local Arm1 = CreatePart(3,char,char["Right Arm"].Position,"Neon",0,0,"Really blue","ArmPart",VT(0.1, 0.5, 0.5),false)
- local Arm1Weld = ezweld(Arm1,char["Right Arm"],CF(-0.5,0,0))
- local Arm1Mesh = CreateMesh("SpecialMesh",Arm1,"Sphere","nil","nil",VT(1, 1, 1),VT(0, 0, 0))
- local Arm2 = CreatePart(3,char,char["Left Arm"].Position,"Neon",0,0,"Really blue","ArmPart",VT(0.1, 0.5, 0.5),false)
- local Arm2Weld = ezweld(Arm2,char["Left Arm"],CF(0.5,0,0))
- local Arm2Mesh = CreateMesh("SpecialMesh",Arm2,"Sphere","nil","nil",VT(1, 1, 1),VT(0, 0, 0))
- local Leg1 = CreatePart(3,char,char["Right Leg"].Position,"Neon",0,0,"Really blue","ArmPart",VT(0.1, 1.5, 0.5),false)
- local Leg1Weld = ezweld(Leg1,char["Right Leg"],CF(-0.5,0,0))
- local Leg1Mesh = CreateMesh("SpecialMesh",Leg1,"Sphere","nil","nil",VT(1, 1, 1),VT(0, 0, 0))
- local Leg2 = CreatePart(3,char,char["Left Leg"].Position,"Neon",0,0,"Really blue","ArmPart",VT(0.1, 1.5, 0.5),false)
- local Leg2Weld = ezweld(Leg2,char["Left Leg"],CF(0.5,0,0))
- local Leg2Mesh = CreateMesh("SpecialMesh",Leg2,"Sphere","nil","nil",VT(1, 1, 1),VT(0, 0, 0))
- normalanim = true
- sine=0
- char.Humanoid.Animator:Destroy()
- while game:GetService("RunService").Heartbeat:Wait() do
- if normalanim then
- sine = sine + 1
- end
- local touchfloor = workspace:FindPartOnRay(Ray.new(char.HumanoidRootPart.CFrame.Position, ((CFrame.new(char.HumanoidRootPart.Position, char.HumanoidRootPart.Position - Vector3.new(0, 1, 0))).LookVector).Unit * 4), char)
- if char.HumanoidRootPart.Velocity.Magnitude > 1 and touchfloor then
- animpose = "Walking"
- elseif char.HumanoidRootPart.Velocity.Y > 0.5 and touchfloor == nil then
- animpose = "Jumping"
- elseif char.HumanoidRootPart.Velocity.Y < 0.5 and touchfloor == nil then
- animpose = "Falling"
- else
- animpose = "Idle"
- end
- if animpose == "Idle" and normalanim then
- RS.C0 = RS.C0:Lerp(RSnor * CFrame.new(0, 0, 0) * CFrame.Angles(-0.5 - 0.25 * COS(sine / 12), 0, 0), 0.15)
- LS.C0 = LS.C0:Lerp(LSnor * CFrame.new(0, 0, 0) * CFrame.Angles(-0.5 - 0.25 * COS(sine / 12), 0, 0), 0.15)
- RH.C0 = RH.C0:Lerp(RHnor * CFrame.new(0, 0, 0), 0.15)
- LH.C0 = LH.C0:Lerp(LHnor * CFrame.new(-0.5, 0.5 + 0.25 * COS(sine / 12), 0), 0.15)
- rootj.C0 = rootj.C0:Lerp(CFrame.new(0, -3 - 0.1 * COS(sine / 12), 0), 0.15)
- neck.C0 = neck.C0:Lerp(necknor * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), 0.15)
- elseif animpose == "Walking" and normalanim then
- RS.C0 = RS.C0:Lerp(RSnor * CFrame.new(0, 0, 0) * CFrame.Angles(-0.5 - 0.25 * COS(sine / 12), 0, -1), 0.15)
- LS.C0 = LS.C0:Lerp(LSnor * CFrame.new(0, 0, 0) * CFrame.Angles(-0.5 - 0.25 * COS(sine / 12), 0, 1), 0.15)
- RH.C0 = RH.C0:Lerp(RHnor * CFrame.new(0, 0, 0), 0.15)
- LH.C0 = LH.C0:Lerp(LHnor * CFrame.new(-0.5, 0.5 + 0.25 * COS(sine / 12), 0), 0.15)
- rootj.C0 = rootj.C0:Lerp(CFrame.new(0, -3 - 0.1 * COS(sine / 12), -0.5) * CFrame.Angles(1, 0, 0), 0.15)
- neck.C0 = neck.C0:Lerp(necknor * CFrame.new(0, 0, 0) * CFrame.Angles(-1, 0, 0), 0.15)
- elseif animpose == "Jumping" and normalanim then
- rootj.C0 = rootj.C0:Lerp(rootjnor * CFrame.Angles(-0.5, 0, 0), 0.15)
- RS.C0 = RS.C0:Lerp(RSnor * CFrame.Angles(-0.3, 0, 0), 0.15)
- LS.C0 = LS.C0:Lerp(LSnor * CFrame.Angles(-0.3, 0, 0), 0.15)
- RH.C0 = RH.C0:Lerp(RHnor, 0.15)
- LH.C0 = LH.C0:Lerp(LHnor, 0.15)
- elseif animpose == "Falling" and normalanim then
- rootj.C0 = rootj.C0:Lerp(rootjnor * CFrame.Angles(0.5, 0, 0), 0.15)
- RS.C0 = RS.C0:Lerp(RSnor * CFrame.Angles(-0.6, 0, 0), 0.15)
- LS.C0 = LS.C0:Lerp(LSnor * CFrame.Angles(-0.6, 0, 0), 0.15)
- RH.C0 = RH.C0:Lerp(RHnor, 0.15)
- LH.C0 = LH.C0:Lerp(LHnor, 0.15)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement