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,Mouse,mouse,UserInputService,ContextActionService = owner
- local RealPlayer = Player
- do print("FE Compatibility code by Mokiros")local a=RealPlayer;script.Parent=a.Character;local b=Instance.new("RemoteEvent")b.Name="UserInput_Event"local function c()local d={_fakeEvent=true,Functions={},Connect=function(self,e)table.insert(self.Functions,e)end}d.connect=d.Connect;return d end;local f={Target=nil,Hit=CFrame.new(),KeyUp=c(),KeyDown=c(),Button1Up=c(),Button1Down=c(),Button2Up=c(),Button2Down=c()}local g={InputBegan=c(),InputEnded=c()}local CAS={Actions={},BindAction=function(self,h,i,j,...)CAS.Actions[h]=i and{Name=h,Function=i,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function k(self,l,...)local d=f[l]if d and d._fakeEvent then for m,e in pairs(d.Functions)do e(...)end end end;f.TrigEvent=k;g.TrigEvent=k;b.OnServerEvent:Connect(function(n,o)if n~=a then return end;f.Target=o.Target;f.Hit=o.Hit;if not o.isMouse then local p=o.UserInputState==Enum.UserInputState.Begin;if o.UserInputType==Enum.UserInputType.MouseButton1 then return f:TrigEvent(p and"Button1Down"or"Button1Up")end;if o.UserInputType==Enum.UserInputType.MouseButton2 then return f:TrigEvent(p and"Button2Down"or"Button2Up")end;for m,d in pairs(CAS.Actions)do for m,q in pairs(d.Keys)do if q==o.KeyCode then d.Function(d.Name,o.UserInputState,o)end end end;f:TrigEvent(p and"KeyDown"or"KeyUp",o.KeyCode.Name:lower())g:TrigEvent(p and"InputBegan"or"InputEnded",o,false)end end)b.Parent=NLS([==[local a=game:GetService("Players").LocalPlayer;local b=script:WaitForChild("UserInput_Event")local c=a:GetMouse()local d=game:GetService("UserInputService")local e=function(f,g)if g then return end;b:FireServer({KeyCode=f.KeyCode,UserInputType=f.UserInputType,UserInputState=f.UserInputState,Hit=c.Hit,Target=c.Target})end;d.InputBegan:Connect(e)d.InputEnded:Connect(e)local h,i;while wait(1/30)do if h~=c.Hit or i~=c.Target then h,i=c.Hit,c.Target;b:FireServer({isMouse=true,Target=i,Hit=h})end end]==],Player.Character)local r=game;local s={__index=function(self,q)local t=rawget(self,"_RealService")if t then return typeof(t[q])=="function"and function(m,...)return t[q](t,...)end or t[q]end end,__newindex=function(self,q,u)local t=rawget(self,"_RealService")if t then t[q]=u end end}local function v(d,w)d._RealService=typeof(w)=="string"and r:GetService(w)or w;return setmetatable(d,s)end;local x={GetService=function(self,t)return rawget(self,t)or r:GetService(t)end,Players=v({LocalPlayer=v({GetMouse=function(self)return f end},Player)},"Players"),UserInputService=v(g,"UserInputService"),ContextActionService=v(CAS,"ContextActionService"),RunService=v({_btrs={},RenderStepped=r:GetService("RunService").Heartbeat,BindToRenderStep=function(self,h,m,i)self._btrs[h]=self.Heartbeat:Connect(i)end,UnbindFromRenderStep=function(self,h)self._btrs[h]:Disconnect()end},"RunService")}rawset(x.Players,"localPlayer",x.Players.LocalPlayer)x.service=x.GetService;v(x,game)game,owner=x,x.Players.LocalPlayer end local Player = game:GetService("Players").LocalPlayer
- local Character = Player.Character
- local Mouse = Player:GetMouse()
- --Mouse.TargetFilter = workspace
- local Head = Character:WaitForChild("Head")
- local Torso = Character:WaitForChild("Torso")
- local RootPart = Character:WaitForChild("HumanoidRootPart")
- local Human = Character:WaitForChild("Humanoid")
- Human.AutoRotate = false
- Human.JumpPower = 0
- Human.WalkSpeed = 12
- -----------------------------------------------------------------------------------------------------------------------
- for _, Item in next, Character:GetChildren() do
- if Item:IsA("CharacterAppearance") then
- Item:Destroy()
- end
- end
- local Pants = Character:FindFirstChild("Pants") or Instance.new("Pants")
- Pants.PantsTemplate = "rbxassetid://69232474"
- Pants.Name = "Pants"
- Pants.Parent = Character
- local Shirt = Character:FindFirstChild("Shirt") or Instance.new("Shirt")
- Shirt.ShirtTemplate = "rbxassetid://69232183"
- Shirt.Name = "Shirt"
- Shirt.Parent = Character
- local Face = Head:WaitForChild("face")
- Face.Texture = "rbxassetid://112805849"
- local TShirt = Torso:FindFirstChild("roblox")
- if TShirt then
- TShirt:Destroy()
- end
- --[[local BodyColors = Character:WaitForChild("Body Colors")
- BodyColors.HeadColor = BrickColor.new("Light orange")
- BodyColors.LeftArmColor = BrickColor.new("Light orange")
- BodyColors.RightArmColor = BrickColor.new("Light orange")
- BodyColors.TorsoColor = BrickColor.new("Light orange")--]]
- spawn(function() wait(.5)
- Head.BrickColor = BrickColor.new("Light orange")
- Torso.BrickColor = BrickColor.new("Light orange")
- Character["Left Arm"].BrickColor = BrickColor.new("Light orange")
- Character["Right Arm"].BrickColor = BrickColor.new("Light orange")
- end)
- Character:WaitForChild("Animate"):Destroy()
- local RJ = RootPart:WaitForChild("RootJoint")
- RJ:Destroy()
- RJ = Instance.new("Weld", RootPart)
- RJ.Part0 = RootPart
- RJ.Part1 = Torso
- local Neck = Instance.new("Weld", Torso)
- Neck.Part0 = Torso
- Neck.Part1 = Character:WaitForChild("Head")
- Neck.C0 = CFrame.new(0, 1.5, 0)
- Torso:WaitForChild("Right Shoulder").Part1 = nil
- local RS = Instance.new("Weld", Head)
- RS.Part0 = Head
- RS.Part1 = Character:WaitForChild("Right Arm")
- Torso:WaitForChild("Left Shoulder").Part1 = nil
- local LS = Instance.new("Weld", Head)
- LS.Part0 = Head
- LS.Part1 = Character:WaitForChild("Left Arm")
- local LH = Torso:WaitForChild("Left Hip")
- LH:Destroy()
- LH = Instance.new("Weld", Torso)
- LH.Part0 = Torso
- LH.Part1 = Character:WaitForChild("Left Leg")
- local RH = Torso:WaitForChild("Right Hip")
- RH:Destroy()
- RH = Instance.new("Weld", Torso)
- RH.Part0 = Torso
- RH.Part1 = Character:WaitForChild("Right Leg")
- local GUN = Instance.new("Part", Character)
- GUN.CanCollide = false
- GUN.Size = Vector3.new(1.549, 2.302, 3.814)
- GUN.Name = "Handle"
- GUN.Material = Enum.Material.SmoothPlastic
- local MS = Instance.new("SpecialMesh", GUN)
- MS.MeshType = Enum.MeshType.FileMesh
- MS.MeshId = "rbxassetid://450812185"
- MS.TextureId = "rbxassetid://450812194"
- local GRIP = Instance.new("Weld", RS.Part1)
- GRIP.Part0 = RS.Part1
- GRIP.Part1 = GUN
- local SN = Instance.new("Sound", GUN)
- SN.SoundId = "rbxassetid://341294387"
- SN.PlaybackSpeed = 0.9
- SN.Looped = true
- SN.Volume = 0
- SN:Play()
- local FL = Instance.new("Part", GUN)
- FL.BrickColor = BrickColor.Yellow()
- FL.Transparency = 1
- FL.Material = Enum.Material.SmoothPlastic
- FL.CanCollide = false
- FL.Size = Vector3.new(1, 3.38, 1)
- local MS2 = Instance.new("SpecialMesh", FL)
- MS2.MeshType = Enum.MeshType.FileMesh
- MS2.MeshId = "rbxassetid://1323306"
- MS2.Scale = Vector3.new(0.35, 1.9, 0.35)
- local FLW = Instance.new("Weld", GUN)
- FLW.Part0 = GUN
- FLW.Part1 = FL
- FLW.C0 = CFrame.new(0.293, 0.251, 3.221, 0, 0.028, 1, 1, 0, 0, 0, 1, -0.028)
- -----------------------------------------------------------------------------------------------------------------------
- local STANCE = {
- NK = CFrame.new(0, 1, 0, 0.747311652, 0, 0.664473772, 0, 1, 0, -0.664473772, 0, 0.747311652);
- RJ = CFrame.new(0, 0, 0, 0.747311592, 0, -0.664473712, 0, 1, 0, 0.664473712, 0, 0.747311592);
- LS = CFrame.new(0.474761963, -1.61745477, -1.20455933, -0.127145067, -0.88503027, -0.447834671, -0.836402416, 0.338357687, -0.431213528, 0.533165276, 0.319743276, -0.783262014);
- RS = CFrame.new(1.14480591, -1.47239065, 0.695491791, 0.972185493, -0.190045089, -0.136889026, 0.123703048, 0.912935674, -0.388903707, 0.198880106, 0.361152887, 0.911051929);
- GRIP = CFrame.new(-0.0976009369, -1.92251587, -1.31733322, -0.980839312, 0.117544398, -0.155363142, 0.158846945, 0.944226265, -0.288452089, 0.11279203, -0.307604104, -0.944805682);
- }
- LS.C0 = STANCE.LS
- RS.C0 = STANCE.RS
- RJ.C0 = STANCE.RJ
- GRIP.C0 = STANCE.GRIP
- local Down = false
- Mouse.Button1Down:Connect(function()
- Down = true
- end)
- Mouse.Button1Up:Connect(function()
- Down = false
- end)
- math.randomseed(os.time())
- local function Taunt()
- local Taunts = {137542750, 130774824, 130776108, 679798995, 679798810}
- local Sound = Instance.new("Sound", GUN)
- local Id = Taunts[math.random(#Taunts)]
- Sound.TimePosition = Id == 130776108 and 4.2 or 0
- Sound.SoundId = "rbxassetid://" .. Id
- Sound.Volume = 1
- Sound.Ended:Connect(function()
- Sound:Destroy()
- end)
- Sound:Play()
- end
- Mouse.KeyDown:Connect(function(Key)
- if Key == string.char(32) then
- Taunt()
- end
- end)
- local function Shoot()
- local Bullet = Instance.new("Part")
- Bullet.Size = Vector3.new(0.3, 0.3, 0.7)
- Bullet.Transparency = 1
- Bullet.CanCollide = false
- local AntiGravity = Instance.new("BodyForce", Bullet)
- AntiGravity.Force = Vector3.new(0, Bullet:GetMass() * workspace.Gravity, 0)
- local Start = (GUN.CFrame * CFrame.new(0.255, 0.251, 1.877)).p
- Bullet.CFrame = CFrame.new(Start, Mouse.Hit.p)
- Bullet.Velocity = Bullet.CFrame.lookVector * 300
- Bullet.Touched:Connect(function(Hit)
- if Hit.Parent and Hit.Parent ~= Character and Hit.Parent:FindFirstChild("Humanoid") then
- Hit.Parent.Humanoid:TakeDamage(5)
- Bullet:Destroy()
- end
- end)
- Bullet.Parent = workspace
- game.Debris:AddItem(Bullet, 3)
- end
- game:GetService("RunService"):BindToRenderStep("Invisible", Enum.RenderPriority.Character.Value - 1, function()
- GUN.LocalTransparencyModifier = 0
- FL.LocalTransparencyModifier = 0
- LS.Part1.LocalTransparencyModifier = 0
- RS.Part1.LocalTransparencyModifier = 0
- end)
- local Heartbeat, Angle = game:GetService("RunService").Heartbeat
- while Heartbeat:Wait() do
- local Angle = tick() * 8
- -- Torso lean
- local VelocityForTilt = RootPart.Velocity * Vector3.new(1, 0, 1) / 150
- local VectorForTilt = RootPart.CFrame:vectorToObjectSpace(VelocityForTilt)
- RJ.C0 = RJ.C0:Lerp(STANCE.RJ * CFrame.Angles(VectorForTilt.Z, VectorForTilt.X, -VectorForTilt.X), 0.1)
- -- Rotate to face camera
- local RootPosition = RootPart.Position
- local Direction = Mouse.Hit.p - RootPosition
- Direction = Vector3.new(Direction.X, 0, Direction.Z).unit
- local NewCFrame = CFrame.new(RootPosition, RootPosition + Direction) * CFrame.Angles(0, -0.02, 0)
- RootPart.CFrame = RootPart.CFrame:Lerp(NewCFrame, 0.1)
- -- Neck Angle
- local Hypotenuse = (Mouse.Hit.p - Head.Position).magnitude
- local Opposite = Mouse.Hit.p.y - Head.Position.y
- local Pitch = math.asin(Opposite / Hypotenuse)
- local NewNeckCFrame = STANCE.NK * CFrame.Angles(Pitch + 0.2, 0, 0) * CFrame.new(0, 0.5, 0)
- Neck.C0 = Neck.C0:Lerp(NewNeckCFrame, 0.1)
- -- Legs
- local FlatVelocity = (Torso.Velocity * Vector3.new(1, 0, 1))
- if FlatVelocity.magnitude < 2 then
- LH.C0 = LH.C0:Lerp(CFrame.new(-0.5, -1, 0) * CFrame.Angles(math.sin(tick() * 0.5) / 17, 0, -0.02 + math.sin(tick() * 0.4) / 19) * CFrame.new(0, -1, 0), 0.2)
- RH.C0 = RH.C0:Lerp(CFrame.new(0.5, -1, 0) * CFrame.Angles(math.sin(-tick() * 0.5) / 18, 0, 0.02 + math.sin(-tick() * 0.35) / 20) * CFrame.new(0, -1, 0), 0.2)
- else
- local Look = (Torso.CFrame.lookVector * Vector3.new(1, 0, 1)).unit
- local Move = FlatVelocity.unit
- local OffAngle = (Look:Cross(Move).Y > 0 and 1 or -1) * math.acos(1 - (Look - Move).magnitude ^ 2 / 2)
- OffAngle = math.max(-math.pi, math.min(math.pi, OffAngle))
- LH.C0 = LH.C0:Lerp(CFrame.new(-0.5, 0, 0) * CFrame.Angles(0, OffAngle, 0)
- * CFrame.new(0, -math.max(0, math.cos(Angle * 2) / 5) + math.max(0, math.cos(Angle + math.pi) / 2.5) - 2, math.sin(-Angle + math.pi) / 1.8 + 0.15)
- * CFrame.Angles(math.sin(-Angle) / 1.8 - 0.2, 0, 0), 0.2)
- RH.C0 = RH.C0:Lerp(CFrame.new(0.5, 0, 0) * CFrame.Angles(0, OffAngle, 0)
- * CFrame.new(0, -math.max(0, math.cos(Angle * 2) / 5) + math.max(0, math.cos(Angle) / 2.5) - 2, math.sin(-Angle) / 1.8 + 0.15)
- * CFrame.Angles(math.sin(Angle) / 1.8 - 0.2, 0, 0), 0.2)
- end
- -- Shooting
- if Down then
- SN.Volume = SN.Volume + (1.5 - SN.Volume) * 0.3
- FL.Transparency = FL.Transparency + (0.6 - FL.Transparency) * 0.2
- FLW.C0 = FLW.C0 * CFrame.Angles(0, 0.2, 0)
- Shoot()
- else
- SN.Volume = SN.Volume + (0 - SN.Volume) * 0.15
- FL.Transparency = FL.Transparency + (1 - FL.Transparency) * 0.2
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement