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
- -- doomguy script
- -- made by SLIVER9230
- -- go crazy
- 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("so uh,blood an gore warnign bitchhhh")
- 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
- wait(0.1)
- local mosic = Instance.new("Sound",workspace)
- mosic.SoundId = "rbxassetid://1150867044"
- mosic.Looped = true
- mosic:Play()
- mosic.Volume = 0.5
- local p = owner
- local char = p.Character
- local movy = 0
- local rev = Instance.new("ReverbSoundEffect",mosic)
- rev.WetLevel = 15
- rev.DecayTime = 7.065
- rev.DryLevel = 20
- local timee = 0
- local keydown = 0
- local bang = 0
- char.Humanoid.WalkSpeed = 30
- local DoomUi = Instance.new("ScreenGui")
- local ImageLabel2 = Instance.new("ImageLabel")
- mouse.Icon = "http://www.roblox.com/asset/?id=409468479"
- DoomUi.Name = "DoomUi"
- DoomUi.Parent = p.PlayerGui
- DoomUi.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- ImageLabel2.Parent = DoomUi
- ImageLabel2.BackgroundColor3 = Color3.new(1, 1, 1)
- ImageLabel2.BackgroundTransparency = 1
- ImageLabel2.Position = UDim2.new(0.423069268, -30, 0.662924349, 0)
- ImageLabel2.Size = UDim2.new(0, 192, 0, 245)
- ImageLabel2.Image = "rbxassetid://155328204"
- p.CameraMode = "LockFirstPerson"
- mouse.KeyDown:connect(function(k)
- if k == "w" then
- movy = 1
- keydown = keydown + 1
- end
- if k == "s" then
- movy = 1
- keydown = keydown + 1
- end
- if k == "a" then
- movy = 1
- keydown = keydown + 1
- end
- if k == "d" then
- movy = 1
- keydown = keydown + 1
- end
- end)
- mouse.Button1Down:connect(function()
- local target = mouse.Target
- if target.Name == "GlassTrig" then
- target.InstaTrig.Disabled = false
- target.Script:Destroy()
- end
- if target.Parent:WaitForChild("Humanoid",0.1) then
- if target.Name ~= "Head" then
- target.Velocity = Vector3.new(math.random(-20,20),math.random(-20,20),math.random(-20,20))
- target.Parent:WaitForChild("Humanoid",0.1).Health = mouse.Target.Parent:WaitForChild("Humanoid",0.1).Health - 50
- else
- target.Velocity = Vector3.new(math.random(-40,50),math.random(20,30),math.random(-40,40))
- target.Parent:WaitForChild("Humanoid",0.1).Health = mouse.Target.Parent:WaitForChild("Humanoid",0.1).Health - 70
- end
- local bl = Instance.new("ParticleEmitter",mouse.Target)
- bl.Name = "blood"
- bl.Color = ColorSequence.new(Color3.fromRGB(255,0,0))
- bl.Size = NumberSequence.new(0.7,5)
- bl.Acceleration = Vector3.new(0,-49,0)
- bl.Rate = 390
- bl.Speed = NumberRange.new(5,20)
- bl.SpreadAngle = Vector2.new(80,80)
- bl.Texture = "rbxassetid://785035165"
- for i = 1,math.random(10,20) do
- local bloodpart = Instance.new("Part",workspace)
- local num = math.random(1,2)
- bloodpart.Size = Vector3.new(0.1,num,num)
- bloodpart.Shape = Enum.PartType.Cylinder
- bloodpart.CFrame = target.CFrame * CFrame.new(math.random(-1,1),math.random(-1,1),math.random(-1,1))
- bloodpart.Material = "SmoothPlastic"
- bloodpart.Velocity = Vector3.new(math.random(-30,30),math.random(12,35),math.random(-30,30))
- bloodpart.BrickColor = BrickColor.new("Maroon")
- end
- end
- local ligh = Instance.new("PointLight",char.Torso)
- ligh.Color = Color3.fromRGB(255, 223, 142)
- ligh.Brightness = "25.24"
- ligh.Range = 8
- local ImageLabel = Instance.new("ImageLabel")
- bang = 1
- ImageLabel.Parent = DoomUi
- ImageLabel.BackgroundColor3 = Color3.new(1, 1, 1)
- ImageLabel.BackgroundTransparency = 1
- ImageLabel.Position = UDim2.new(0.266489582, 0, 0.310410094, 0)
- ImageLabel.Size = UDim2.new(0, 443, 0, 443)
- ImageLabel.ZIndex = -1
- ImageLabel.Image = "http://www.roblox.com/asset/?id=203940770"
- local pew = Instance.new("Sound",char.Torso)
- pew.SoundId = "rbxassetid://2723750380"
- pew.Volume = 4
- pew:Play()
- wait(0.1)
- ligh:Destroy()
- if target.Parent:WaitForChild("Humanoid",0.1) and target.Parent:WaitForChild("Torso",0.1) then
- target.blood.Enabled = false
- end
- ImageLabel:Destroy()
- bang = 0
- ImageLabel2:TweenPosition(UDim2.new(0.423, -30,0.663, 0),'InOut','Quad',0.1)
- ImageLabel2.ImageColor3 = Color3.fromRGB(255, 255, 255)
- wait(4.5)
- pew:Destroy()
- if target.Parent:WaitForChild("Humanoid",0.1) and target then
- target.blood:Destroy()
- end
- end)
- mouse.KeyUp:connect(function(k)
- if k == "w" and keydown == 1 then
- movy = 0
- timee = 0
- keydown = keydown - 1
- end
- if k == "a" and keydown == 1 then
- movy = 0
- timee = 0
- keydown = keydown - 1
- end
- if k == "s" and keydown == 1 then
- movy = 0
- timee = 0
- keydown = keydown - 1
- end
- if k == "d" and keydown == 1 then
- movy = 0
- timee = 0
- keydown = keydown - 1
- end
- if k == "w" and keydown == 2 then
- keydown = keydown - 1
- end
- if k == "a" and keydown == 2 then
- keydown = keydown - 1
- end
- if k == "s" and keydown == 2 then
- keydown = keydown - 1
- end
- if k == "d" and keydown == 2 then
- keydown = keydown - 1
- end
- if k == "w" and keydown == 3 then
- keydown = keydown - 1
- end
- if k == "a" and keydown == 3 then
- keydown = keydown - 1
- end
- if k == "s" and keydown == 3 then
- keydown = keydown - 1
- end
- if k == "d" and keydown == 3 then
- keydown = keydown - 1
- end
- if k == "w" and keydown == 4 then
- keydown = keydown - 1
- end
- if k == "a" and keydown == 4 then
- keydown = keydown - 1
- end
- if k == "s" and keydown == 4 then
- keydown = keydown - 1
- end
- if k == "d" and keydown == 4 then
- keydown = keydown - 1
- end
- end)
- while wait() do
- if movy == 1 and bang ==0 then
- timee = timee + 1
- ImageLabel2:TweenPosition(UDim2.new(0.1*math.cos(timee/4)+0.423,-30,math.abs(0.05*math.sin(timee/4)+0.663),0),'InOut','Quad',0.05)
- end
- if movy == 0 and bang ==0 then
- ImageLabel2:TweenPosition(UDim2.new(0.423, -30,0.663, 0),'InOut','Quad',0.3)
- end
- if bang == 1 then
- ImageLabel2:TweenPosition(UDim2.new(0.423, -30,0.763, 0),'Out','Quad',0.1)
- ImageLabel2.ImageColor3 = Color3.fromRGB(255, 206, 157)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment