Advertisement
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,Mouse,mouse,UserInputService,ContextActionService = owner
- do
- print("FE Compatibility code by Mokiros")
- 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
- --[[
- Objects Skipped: 41
- IntValue: 4
- UnionOperation: 31
- LocalScript: 1
- NumberValue: 1
- ModuleScript: 3
- Script: 1
- --]]
- local ak47 = Instance.new("Tool")
- local thumbnailcamera = Instance.new("Camera")
- local aimpart = Instance.new("Part")
- local mesh = Instance.new("SpecialMesh")
- local chamber = Instance.new("Part")
- local mesh_2 = Instance.new("CylinderMesh")
- local handle = Instance.new("Part")
- local magout = Instance.new("Sound")
- local magin = Instance.new("Sound")
- local prime = Instance.new("Sound")
- local mesh_3 = Instance.new("BlockMesh")
- local firesound = Instance.new("Sound")
- local main = Instance.new("Part")
- local mesh_4 = Instance.new("BlockMesh")
- local N1flashfxsmoke = Instance.new("ParticleEmitter")
- local flashfxflash = Instance.new("ParticleEmitter")
- local flashfxlight = Instance.new("PointLight")
- ak47.Name = "AK47"
- ak47.ToolTip = "Russian Assualt Rifle"
- ak47.Parent = game.StarterPack
- thumbnailcamera.FieldOfView = 40
- thumbnailcamera.Name = "ThumbnailCamera"
- thumbnailcamera.Focus = CFrame.new(154.373, 1.018, -87.883)
- thumbnailcamera.CFrame = CFrame.new(154.346, 0.976, -89.882) * CFrame.Angles(3.121, -0.013, 3.141)
- thumbnailcamera.Parent = AK47
- aimpart.Anchored = true
- aimpart.CanCollide = false
- aimpart.Size = Vector3.new(0.212, 0.212, 0.212)
- aimpart.Orientation = Vector3.new(0, 90, 0)
- aimpart.BottomSurface = Enum.SurfaceType.Smooth
- aimpart.Material = Enum.Material.SmoothPlastic
- aimpart.Name = "AimPart"
- aimpart.Transparency = 1
- aimpart.TopSurface = Enum.SurfaceType.Smooth
- aimpart.BrickColor = BrickColor.new("Black")
- aimpart.Color = Color3.new(0.105882, 0.164706, 0.207843)
- aimpart.Parent = AK47
- aimpart.CFrame = CFrame.new(155.685, 1.174, -84.508) * CFrame.Angles(1.478, 1.568, -1.49)
- mesh.Scale = Vector3.new(0.044, 0.042, 83.227)
- mesh.MeshType = Enum.MeshType.Brick
- mesh.Parent = AimPart
- chamber.Anchored = true
- chamber.CanCollide = false
- chamber.Size = Vector3.new(0.212, 0.212, 0.212)
- chamber.BottomSurface = Enum.SurfaceType.Smooth
- chamber.Orientation = Vector3.new(0, 30, 90.03)
- chamber.Name = "Chamber"
- chamber.Transparency = 1
- chamber.TopSurface = Enum.SurfaceType.Smooth
- chamber.Parent = AK47
- chamber.CFrame = CFrame.new(154.462, 1.035, -84.553) * CFrame.Angles(0, 0.524, 1.571)
- mesh_2.Scale = Vector3.new(0.285, 0.856, 0.285)
- mesh_2.Parent = Chamber
- handle.Anchored = true
- handle.CanCollide = false
- handle.Size = Vector3.new(0.2, 0.2, 0.2)
- handle.Orientation = Vector3.new(0, 89.99, 0)
- handle.BottomSurface = Enum.SurfaceType.Smooth
- handle.Material = Enum.Material.SmoothPlastic
- handle.Name = "Handle"
- handle.Transparency = 1
- handle.TopSurface = Enum.SurfaceType.Smooth
- handle.BrickColor = BrickColor.new("Dark stone grey")
- handle.Color = Color3.new(0.388235, 0.372549, 0.384314)
- handle.Parent = AK47
- handle.CFrame = CFrame.new(154.999, 0.468, -84.507) * CFrame.Angles(0, 1.571, 0)
- magout.Volume = 1
- magout.Name = "MagOut"
- magout.SoundId = "rbxassetid://457042936"
- magout.Parent = Handle
- magin.Volume = 1
- magin.Name = "MagIn"
- magin.SoundId = "rbxassetid://457043231"
- magin.Parent = Handle
- prime.Volume = 1
- prime.Name = "Prime"
- prime.SoundId = "rbxassetid://206942149"
- prime.Parent = Handle
- mesh_3.Scale = Vector3.new(0.742, 0.706, 0.706)
- mesh_3.Parent = Handle
- firesound.Name = "FireSound"
- firesound.SoundId = "rbxassetid://766484843"
- firesound.RollOffMode = Enum.RollOffMode.Linear
- firesound.Volume = 3
- firesound.Parent = Handle
- main.Anchored = true
- main.CanCollide = false
- main.Size = Vector3.new(0.212, 0.212, 0.212)
- main.Orientation = Vector3.new(90, -90.01, 0)
- main.BottomSurface = Enum.SurfaceType.Smooth
- main.Material = Enum.Material.SmoothPlastic
- main.Name = "Main"
- main.Transparency = 1
- main.TopSurface = Enum.SurfaceType.Smooth
- main.BrickColor = BrickColor.new("Bright orange")
- main.Color = Color3.new(0.854902, 0.521569, 0.254902)
- main.Parent = AK47
- main.CFrame = CFrame.new(152.146, 0.928, -84.506) * CFrame.Angles(1.571, 0, 1.571)
- mesh_4.Scale = Vector3.new(0.764, 0.727, 0.727)
- mesh_4.Parent = Main
- N1flashfxsmoke.Enabled = false
- N1flashfxsmoke.Name = "1FlashFX[Smoke]"
- N1flashfxsmoke.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0, 0.6), NumberSequenceKeypoint.new(1, 1)})
- N1flashfxsmoke.Lifetime = NumberRange.new(1.25, 1.5)
- N1flashfxsmoke.LightEmission = 0.1
- N1flashfxsmoke.Speed = NumberRange.new(5, 7)
- N1flashfxsmoke.Color = ColorSequence.new(Color3.new(0.27451, 0.27451, 0.27451), Color3.new(0.27451, 0.27451, 0.27451))
- N1flashfxsmoke.Rotation = NumberRange.new(0, 360)
- N1flashfxsmoke.Rate = 100
- N1flashfxsmoke.RotSpeed = NumberRange.new(10)
- N1flashfxsmoke.Texture = "http://www.roblox.com/asset/?id=244514423"
- N1flashfxsmoke.Size = NumberSequence.new({NumberSequenceKeypoint.new(0, 0), NumberSequenceKeypoint.new(1, 0)})
- N1flashfxsmoke.SpreadAngle = Vector2.new(15, 15)
- N1flashfxsmoke.Parent = Main
- flashfxflash.Enabled = false
- flashfxflash.Lifetime = NumberRange.new(0.05, 0.075)
- flashfxflash.LightEmission = 1
- flashfxflash.Name = "FlashFX[Flash]"
- flashfxflash.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0, 1), NumberSequenceKeypoint.new(0.636, 0.9, 0.069), NumberSequenceKeypoint.new(0.955, 0.887, 0.05), NumberSequenceKeypoint.new(1, 1)})
- flashfxflash.Rate = 1000
- flashfxflash.Color = ColorSequence.new(Color3.new(1, 1, 0.498039), Color3.new(1, 1, 0.498039))
- flashfxflash.RotSpeed = NumberRange.new(22)
- flashfxflash.Texture = "http://www.roblox.com/asset/?id=242102147"
- flashfxflash.Parent = Main
- flashfxlight.Enabled = false
- flashfxlight.Brightness = 10
- flashfxlight.Range = 0
- flashfxlight.Color = Color3.new(1, 1, 0.498039)
- flashfxlight.Name = "FlashFX[Light]"
- flashfxlight.Parent = Main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement