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
- --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
- for i,v in pairs(game.Players:GetPlayers()) do
- local Player = v
- local Sound = Instance.new("Sound",workspace)
- Sound.Volume = 3
- repeat wait() until Player.Character ~= nil
- local Character = Player.Character
- local Torso = Character:WaitForChild("HumanoidRootPart")
- math.randomseed(tick())
- active = true
- if Character:FindFirstChild("Brzad") == nil then
- local tag = Instance.new("BoolValue",Character)
- tag.Name = "Brzad"
- spawn(function()
- wait(10)
- Character["Left Leg"]:Destroy()
- Character["Right Leg"]:Destroy()
- end)
- local Camera = game.Workspace.CurrentCamera
- local RunService = game:GetService("RunService")
- local Songs = {
- "http://www.roblox.com/asset/?id=147788015", -- Momba trap
- "http://www.roblox.com/asset/?id=173038059",
- "http://www.roblox.com/asset/?id=149434122",
- }
- --Sound.SoundId = Songs[math.random(1,#Songs)]
- function TweenFieldOfView(Amount,Bool)
- if Bool then
- for i = 1,Amount do
- Camera.FieldOfView = Camera.FieldOfView + math.random(1,2)
- -- RunService.RenderStepped:wait()
- local rando = math.random(1,60)
- if rando == 60 then
- local old = Camera.FieldOfView
- Camera.FieldOfView = 10
- game.Lighting.FogColor = Color3.new(math.random(1000160,340000160)/255, math.random(1000160,340000160)/255, math.random(1000160,340000160)/255)
- game.Lighting.ColorShift_Bottom = Color3.new(math.random(0,270000160)/255, math.random(0,270000160)/255, math.random(0,270000160)/255)
- game.Lighting.ColorShift_Top = Color3.new(math.random(0,270000160)/255, math.random(0,270000160)/255, math.random(0,270000160)/255)
- game.Lighting.OutdoorAmbient = Color3.new(math.random(0,270000160)/255, math.random(0,270000160)/255, math.random(0,270000160)/255)
- wait()
- Camera.FieldOfView = old
- elseif rando <= 3 then
- local old = Camera.FieldOfView
- Camera.FieldOfView = Camera.FieldOfView + 30
- wait()
- Camera.FieldOfView = old
- end
- wait()
- end -- 90
- else
- for i = 1,Amount do
- Camera.FieldOfView = Camera.FieldOfView - math.random(1,2)
- -- RunService.RenderStepped:wait()
- local rando = math.random(1,20)
- wait()
- end -- 90
- end
- end
- Sound:Play()
- spawn(function()
- while active do
- local rando = math.random(-2,2)
- if Sound.Pitch < 0.2 then
- rando = rando + 2
- elseif Sound.Pitch > 2 then
- rando = rando - 1
- elseif Sound.Pitch > 2.6 then
- rando = rando -2
- end
- Sound.Pitch = Sound.Pitch + rando/50
- wait()
- end
- end)
- spawn(function()
- while active do
- -- 70 = norm
- TweenFieldOfView(80,true) -- 90
- TweenFieldOfView(60,false) -- 30
- TweenFieldOfView(40,true) -- 70
- TweenFieldOfView(5,false) -- 40
- TweenFieldOfView(50,true) -- 90
- TweenFieldOfView(100,false) -- 70
- TweenFieldOfView(40,true) -- 70
- TweenFieldOfView(5,false) -- 40
- TweenFieldOfView(20,false) -- 30
- TweenFieldOfView(30,false) -- 30
- TweenFieldOfView(5,false) -- 40
- TweenFieldOfView(20,false) -- 30
- TweenFieldOfView(30,false) -- 30
- TweenFieldOfView(5,false) -- 40
- TweenFieldOfView(20,false) -- 30
- TweenFieldOfView(15,false) -- 30
- TweenFieldOfView(5,false) -- 40
- TweenFieldOfView(20,false) -- 30
- TweenFieldOfView(15,false) -- 30
- TweenFieldOfView(5,false) -- 40
- TweenFieldOfView(20,false) -- 30
- TweenFieldOfView(15,false) -- 30
- TweenFieldOfView(5,false) -- 40
- TweenFieldOfView(20,false) -- 30
- TweenFieldOfView(15,false) -- 30
- TweenFieldOfView(5,false) -- 40
- TweenFieldOfView(20,false) -- 30
- TweenFieldOfView(15,false) -- 30
- TweenFieldOfView(5,false) -- 40
- TweenFieldOfView(20,false) -- 30
- TweenFieldOfView(15,false) -- 30
- TweenFieldOfView(5,false) -- 40
- TweenFieldOfView(20,false) -- 30
- TweenFieldOfView(15,false) -- 30
- TweenFieldOfView(5,false) -- 40
- TweenFieldOfView(20,false) -- 30
- TweenFieldOfView(15,false) -- 30
- end
- end)
- spawn(function()
- game.Lighting.Ambient = Color3.new(0,0,0)
- game.Lighting.Brightness = 99
- game.Lighting.ColorShift_Bottom = Color3.new(270000160/255, 280000160/255, 0)
- game.Lighting.ColorShift_Top = Color3.new(270000160/255, 0, 260000160/255)
- game.Lighting.OutdoorAmbient = Color3.new(0, 280000160/255, 260000160/255)
- game.Lighting.FogColor = Color3.new(270000160/255, 280000160/255, 260000160/255)
- game.Lighting.FogEnd = 1e+014
- game.Lighting.FogStart = 0
- while active do
- RunService.RenderStepped:wait()
- game.Lighting:SetMinutesAfterMidnight(game.Lighting:GetMinutesAfterMidnight()+2)
- end
- end)
- local X_angle = 0
- local Y_angle = 0
- local Z_angle = 0
- local X = 0
- local Y = 2
- local Z = 10
- spawn(function()
- wait(5)
- v.Character.Archivable = true
- local model = Instance.new("Model",v.Character)
- local index = 4
- while active do
- index = index * 0.93
- for i,v in pairs(v.Character:GetChildren()) do
- if v:IsA("BasePart") then
- v.Archivable = true
- local fun = v:Clone()
- fun.Name = "Fun"
- fun.CFrame = v.CFrame
- fun.Parent = model
- fun.CanCollide = true
- fun.Anchored = false
- end
- end
- wait(index)
- end
- end)
- spawn(function()
- wait(40)
- active = false
- workspace.CurrentCamera.FieldOfView = 90
- game.Lighting.Ambient = Color3.new(60/255,60/255,60/255)
- game.Lighting.Brightness = 1
- game.Lighting.ColorShift_Bottom = Color3.new(0,0,0)
- game.Lighting.ColorShift_Top = Color3.new(0,0,0)
- game.Lighting.OutdoorAmbient = Color3.new(150/255,150/255,150/255)
- game.Lighting.FogStart = 0
- game.Lighting.FogEnd = 100000
- game.Lighting.FogColor = Color3.new(191/255,191/255,191/255)
- v.Character.Humanoid.Health=0
- end)
- spawn(function()
- wait(10)
- while active do
- local explode = Instance.new("Explosion",workspace)
- explode.Position = v.Character.PrimaryPart.Position + Vector3.new(math.random(-100,100),math.random(-10,40),math.random(-100,100))
- explode.BlastPressure = 0
- wait()
- end
- end)
- while active do
- Camera.CoordinateFrame = CFrame.new(Torso.Position) --Start at the position of the part
- * CFrame.Angles(X_angle, Y_angle, Z_angle) --Rotate by the angle
- * CFrame.new(X,Y,Z) --Move the camera backwards 5 units
- X_angle = X_angle + math.rad(math.random(0,5))
- Y_angle = Y_angle + math.rad(4)
- Z_angle = Z_angle + math.rad(math.random(0,5))
- local rando = math.random(1,10)
- if rando == 10 then
- old = Z_angle
- Z_angle = Z_angle - math.rad(math.random(10,20))
- wait()
- Z_angle = old
- elseif rando == 1 then
- old = Y_angle
- Y_angle = Y_angle - math.rad(math.random(10,20))
- wait()
- Y_angle = old
- end
- --X = X_angle / 2
- RunService.RenderStepped:wait()
- wait()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement