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
- 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
- mas = char
- BodyColors0 = Instance.new("BodyColors")
- Pants1 = Instance.new("Pants")
- Accessory2 = Instance.new("Accessory")
- Part3 = Instance.new("Part")
- SpecialMesh4 = Instance.new("SpecialMesh")
- Vector3Value5 = Instance.new("Vector3Value")
- CharacterMesh6 = Instance.new("CharacterMesh")
- CharacterMesh7 = Instance.new("CharacterMesh")
- CharacterMesh8 = Instance.new("CharacterMesh")
- CharacterMesh9 = Instance.new("CharacterMesh")
- CharacterMesh10 = Instance.new("CharacterMesh")
- BodyColors0.Parent = mas
- BodyColors0.HeadColor = BrickColor.new("Light orange")
- BodyColors0.HeadColor3 = Color3.new(0.917647, 0.721569, 0.572549)
- BodyColors0.LeftArmColor = BrickColor.new("Light orange")
- BodyColors0.LeftArmColor3 = Color3.new(0.917647, 0.721569, 0.572549)
- BodyColors0.LeftLegColor = BrickColor.new("Light orange")
- BodyColors0.LeftLegColor3 = Color3.new(0.917647, 0.721569, 0.572549)
- BodyColors0.RightArmColor = BrickColor.new("Light orange")
- BodyColors0.RightArmColor3 = Color3.new(0.917647, 0.721569, 0.572549)
- BodyColors0.RightLegColor = BrickColor.new("Light orange")
- BodyColors0.RightLegColor3 = Color3.new(0.917647, 0.721569, 0.572549)
- BodyColors0.TorsoColor = BrickColor.new("Light orange")
- BodyColors0.TorsoColor3 = Color3.new(0.917647, 0.721569, 0.572549)
- Pants1.Name = "Pants"
- Pants1.Parent = mas
- Pants1.PantsTemplate = "http://www.roblox.com/asset/?id=3767402973"
- Accessory2.Name = "Mellow Cowboy"
- Accessory2.Parent = mas
- Accessory2.AttachmentForward = Vector3.new(-0, -0.196096897, -0.980584502)
- Accessory2.AttachmentPoint = CFrame.new(0, -0.170000002, 0.0500000007, 1, 0, 0, -0, 0.980584562, 0.196096897, 0, -0.196096912, 0.980584502)
- Accessory2.AttachmentPos = Vector3.new(0, -0.170000002, 0.0500000007)
- Accessory2.AttachmentUp = Vector3.new(0, 0.980584562, -0.196096912)
- Part3.Name = "Handle"
- Part3.Parent = Accessory2
- Part3.CFrame = CFrame.new(0, 6.19630814, -0.0154210003, 1, -7.71854047e-09, 1.5435262e-09, 7.87136223e-09, 0.980584562, -0.196096912, 2.39808173e-14, 0.196096912, 0.980584562)
- Part3.Orientation = Vector3.new(11.3100004, 0, 0)
- Part3.Position = Vector3.new(0, 6.19630814, -0.0154210003)
- Part3.Rotation = Vector3.new(11.3100004, 0, 0)
- Part3.Size = Vector3.new(1, 1, 2)
- Part3.BottomSurface = Enum.SurfaceType.Smooth
- Part3.CanCollide = false
- Part3.Locked = true
- Part3.TopSurface = Enum.SurfaceType.Smooth
- Part3.FormFactor = Enum.FormFactor.Symmetric
- Part3.formFactor = Enum.FormFactor.Symmetric
- SpecialMesh4.Parent = Part3
- SpecialMesh4.MeshId = "http://www.roblox.com/asset/?id=45915012"
- SpecialMesh4.Scale = Vector3.new(1, 1, 1.01999998)
- SpecialMesh4.TextureId = "http://www.roblox.com/asset/?id=45915003"
- SpecialMesh4.MeshType = Enum.MeshType.FileMesh
- Vector3Value5.Name = "OriginalSize"
- Vector3Value5.Parent = Part3
- Vector3Value5.Value = Vector3.new(1, 1, 2)
- CharacterMesh6.Name = "Penguin Torso"
- CharacterMesh6.Parent = mas
- CharacterMesh6.BaseTextureId = 46345362
- CharacterMesh6.BodyPart = Enum.BodyPart.Torso
- CharacterMesh6.MeshId = 46345096
- CharacterMesh6.OverlayTextureId = 46345222
- CharacterMesh7.Name = "ROBLOX Boy Left Arm"
- CharacterMesh7.Parent = mas
- CharacterMesh7.BodyPart = Enum.BodyPart.LeftArm
- CharacterMesh7.MeshId = 279174949
- CharacterMesh8.Name = "ROBLOX Boy Left Leg"
- CharacterMesh8.Parent = mas
- CharacterMesh8.BodyPart = Enum.BodyPart.LeftLeg
- CharacterMesh8.MeshId = 319336109
- CharacterMesh9.Name = "ROBLOX Boy Right Arm"
- CharacterMesh9.Parent = mas
- CharacterMesh9.BodyPart = Enum.BodyPart.RightArm
- CharacterMesh9.MeshId = 279174886
- CharacterMesh10.Name = "ROBLOX Boy Right Leg"
- CharacterMesh10.Parent = mas
- CharacterMesh10.BodyPart = Enum.BodyPart.RightLeg
- CharacterMesh10.MeshId = 319336155
- SpecialMesh0 = Instance.new("SpecialMesh")
- Decal1 = Instance.new("Decal")
- SpecialMesh0.Parent = head
- SpecialMesh0.Scale = Vector3.new(1.25, 1.25, 1.25)
- Decal1.Name = "face"
- Decal1.Parent = head
- Decal1.Texture = "http://www.roblox.com/asset/?id=27134272"
- cleetus = Instance.new("Sound",head)
- cleetus.SoundId = "rbxassetid://2254648568"
- cleetus.Volume = 2
- cleetus:Play()
- player = owner
- shooting = false
- Part0 = Instance.new("Part")
- SpecialMesh1 = Instance.new("SpecialMesh")
- Part0.Name = "Assault Rifle"
- Part0.Parent = mas
- enabled = false
- function shootsound()
- coroutine.resume(coroutine.create(function()
- shoot = Instance.new("Sound",Part0)
- shoot.Volume = 10
- shoot.PlaybackSpeed = 1
- shoot.SoundId = "rbxassetid://3289652262"
- shoot:Play()
- wait(2)
- shoot:Destroy()
- end))
- end
- function equip()
- coroutine.resume(coroutine.create(function()
- equipsound = Instance.new("Sound",Part0)
- equipsound.Volume = 10
- equipsound.PlaybackSpeed = 1
- equipsound.SoundId = "rbxassetid://3666863095"
- equipsound:Play()
- wait(2)
- equipsound:Destroy()
- end))
- end
- Part0.CFrame = CFrame.new(-7.32639599, 14.2976122, 14.3406916, -0.106925137, 0.994266748, 0.000791709346, 1.85333519e-12, -0.000796274282, 0.999999642, 0.994266987, 0.106925115, 8.51417499e-05)
- Part0.Orientation = Vector3.new(-89.9499969, 83.8600006, 180)
- Part0.Position = Vector3.new(-7.32639599, 14.2976122, 14.3406916)
- Part0.Rotation = Vector3.new(-90, 0.0500000007, -96.1399994)
- Part0.Color = Color3.new(0.105882, 0.164706, 0.207843)
- Part0.Size = Vector3.new(0.400000006, 3.4000001, 0.800000012)
- Part0.BrickColor = BrickColor.new("Black")
- Part0.brickColor = BrickColor.new("Black")
- Part0.FormFactor = Enum.FormFactor.Custom
- Part0.CanCollide = false
- Part0.formFactor = Enum.FormFactor.Custom
- Part0.CanCollide = false
- SpecialMesh1.Parent = Part0
- SpecialMesh1.MeshId = "http://www.roblox.com/asset/?id=72012671"
- SpecialMesh1.VertexColor = Vector3.new(2, 2, 2)
- SpecialMesh1.TextureId = "http://www.roblox.com/asset/?id=72012605"
- SpecialMesh1.MeshType = Enum.MeshType.FileMesh
- weld = Instance.new("Weld",Part0)
- weld.Part0 = nil
- weld.Part1 = Part0
- weld.C0 = CFrame.new(0,-1.5,-0.5) * CFrame.Angles(math.rad(180),math.rad(0),math.rad(-30))
- rs = Instance.new("Weld",char.Torso)
- rs.Part0 = nil
- rs.Part1 = nil
- rs.C0 = CFrame.new(0.5,0.5,-0.5) * CFrame.Angles(math.rad(0),math.rad(120),math.rad(90))
- rs.C1 = char.Torso["Right Shoulder"].C1
- ls = Instance.new("Weld",char.Torso)
- ls.Part0 = nil
- ls.Part1 = nil
- ls.C0 = CFrame.new(-0.6,0.5,-1) * CFrame.Angles(math.rad(180),math.rad(-57),math.rad(90))
- ls.C1 = char.Torso["Left Shoulder"].C1
- holster = Instance.new("Weld",char.Torso)
- holster.C0 = CFrame.new(1,-1,0) * CFrame.Angles(math.rad(65),0,0)
- holster.Part0 = char.Torso
- holster.Part1 = Part0
- Weld1 = Instance.new("Weld")
- BillboardGui2 = Instance.new("BillboardGui")
- ImageLabel3 = Instance.new("ImageLabel")
- Part02 = Instance.new("Part")
- Part02.Parent = Part0
- Part02.CFrame = CFrame.new(-7.52682972, 18.6985626, 9.31794739, 1, -5.96046448e-08, 6.5567086e-08, -6.55670789e-08, 1.1356552e-07, 1, -5.96046448e-08, -1, 1.1356552e-07)
- Part02.Orientation = Vector3.new(-90, 0, 0)
- Part02.Position = Vector3.new(-7.52682972, 18.6985626, 9.31794739)
- Part02.Rotation = Vector3.new(-90, 0, 0)
- Part02.Transparency = 1
- Part02.Size = Vector3.new(1, 1, 1)
- Part02.BottomSurface = Enum.SurfaceType.Smooth
- Part02.TopSurface = Enum.SurfaceType.Smooth
- Part02.CanCollide = false
- Weld1.Parent = Part02
- Weld1.C0 = CFrame.new(0, 2, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Weld1.Part0 = Part0
- Weld1.Part1 = Part02
- Weld1.part1 = Part02
- BillboardGui2.Parent = Part02
- BillboardGui2.LightInfluence = 1
- BillboardGui2.Size = UDim2.new(2, 0, 2, 0)
- BillboardGui2.Active = true
- BillboardGui2.ClipsDescendants = true
- BillboardGui2.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- ImageLabel3.Parent = BillboardGui2
- ImageLabel3.Size = UDim2.new(1, 0, 1, 0)
- ImageLabel3.BackgroundColor = BrickColor.new("Institutional white")
- ImageLabel3.BackgroundColor3 = Color3.new(1, 1, 1)
- ImageLabel3.BackgroundTransparency = 1
- ImageLabel3.ImageTransparency = 1
- ImageLabel3.Image = "http://www.roblox.com/asset/?id=156580315"
- head = char.Head
- gun = false
- game:GetService("RunService").RenderStepped:Connect(function()
- if shooting == true and gun == true then
- shootsound()
- ImageLabel3.ImageTransparency = 0
- ImageLabel3.Rotation = ImageLabel3.Rotation + 90
- if mouse.Target.Anchored == false then
- mouse.Target:BreakJoints()
- p = mouse.Target
- p.Velocity = Vector3.new(p.Velocity.X + (head.CFrame.lookVector.X * 18), p.Velocity.Y + (head.CFrame.lookVector.Y * 18) + 8, p.Velocity.Z + (head.CFrame.lookVector.Z * 18))
- end
- if mouse.Target.Parent:FindFirstChildOfClass("Humanoid") then
- mouse.Target.Parent:FindFirstChildOfClass("Humanoid").Health = mouse.Target.Parent:FindFirstChildOfClass("Humanoid").Health - 43.5
- end
- wait(0.6)
- else
- ImageLabel3.ImageTransparency = 1
- end
- end)
- mouse.Button1Down:Connect(function()
- shooting = true
- end)
- mouse.Button1Up:Connect(function()
- shooting = false
- end)
- mouse.KeyDown:Connect(function(key)
- if key == "g" then
- if gun == false then
- gun = true
- weld.Part0 = char["Right Arm"]
- weld.Part1 = Part0
- holster.Part0 = nil
- holster.Part1 = nil
- equip()
- ls.Part0 = char.Torso["Left Shoulder"].Part0
- ls.Part1 = char.Torso["Left Shoulder"].Part1
- rs.Part0 = char.Torso["Right Shoulder"].Part0
- rs.Part1 = char.Torso["Right Shoulder"].Part1
- else
- gun = false
- weld.Part0 = nil
- weld.Part1 = Part0
- holster.Part0 = char.Torso
- holster.Part1 = Part0
- ls.Part0 = nil
- ls.Part1 = nil
- rs.Part0 = nil
- rs.Part1 = nil
- end
- end
- end)
Add Comment
Please, Sign In to add comment