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;local a=function(b)b[1].f[b[2]]=nil end;local c={__index={disconnect=a,Disconnect=a}}local d={__index={Connect=function(b,e)local f=tostring(math.random(0,10000))while b.f[f]do f=tostring(math.random(0,10000))end;b.f[f]=e;return setmetatable({b,f},c)end}}d.__index.connect=d.__index.Connect;local function g()return setmetatable({f={}},d)end;local h={Hit=CFrame.new(),KeyUp=g(),KeyDown=g(),Button1Up=g(),Button1Down=g(),Button2Up=g(),Button2Down=g()}h.keyUp=h.KeyUp;h.keyDown=h.KeyDown;local i={InputBegan=g(),InputEnded=g()}local CAS={Actions={},BindAction=function(self,j,k,l,...)CAS.Actions[j]=k and{Name=j,Function=k,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function m(self,n,...)for o,e in pairs(self[n].f)do e(...)end end;h.T=m;i.T=m;local p=Instance.new("RemoteEvent")p.Name="UserInput_Event"p.OnServerEvent:Connect(function(q,r)if q~=RealPlayer then return end;h.Target=r.e;h.Hit=r.d;if not r.f then local s=r.c==Enum.UserInputState.Begin;if r.b==Enum.UserInputType.MouseButton1 then return h:T(s and"Button1Down"or"Button1Up")end;if r.b==Enum.UserInputType.MouseButton2 then return h:T(s and"Button2Down"or"Button2Up")end;for o,t in pairs(CAS.Actions)do for o,u in pairs(t.Keys)do if u==r.a then t.Function(t.Name,r.c,r)end end end;h:T(s and"KeyDown"or"KeyUp",r.a.Name:lower())i:T(s and"InputBegan"or"InputEnded",r,false)end end)p.Parent=NLS([==[local a=script:WaitForChild("UserInput_Event")local b=owner:GetMouse()local c=game:GetService("UserInputService")local d=function(e,f)if f then return end;a:FireServer({a=e.KeyCode,b=e.UserInputType,c=e.UserInputState,d=b.Hit,e=b.Target})end;c.InputBegan:Connect(d)c.InputEnded:Connect(d)local g,h;local i=game:GetService("RunService").Heartbeat;while true do if g~=b.Hit or h~=b.Target then g,h=b.Hit,b.Target;a:FireServer({f=1,Target=h,d=g})end;for j=1,2 do i:Wait()end end]==],script)local v=game;local w={__index=function(self,u)local x=rawget(self,"_RealService")if x then return typeof(x[u])=="function"and function(o,...)return x[u](x,...)end or x[u]end end,__newindex=function(self,u,y)local x=rawget(self,"_RealService")if x then x[u]=y end end}local function z(t,A)t._RealService=typeof(A)=="string"and v:GetService(A)or A;return setmetatable(t,w)end;local B={GetService=function(self,x)return rawget(self,x)or v:GetService(x)end,Players=z({LocalPlayer=z({GetMouse=function(self)return h end},Player)},"Players"),UserInputService=z(i,"UserInputService"),ContextActionService=z(CAS,"ContextActionService"),RunService=z({_btrs={},RenderStepped=v:GetService("RunService").Heartbeat,BindToRenderStep=function(self,j,o,k)self._btrs[j]=self.Heartbeat:Connect(k)end,UnbindFromRenderStep=function(self,j)self._btrs[j]:Disconnect()end},"RunService")}rawset(B.Players,"localPlayer",B.Players.LocalPlayer)B.service=B.GetService;z(B,game)game,owner=B,B.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