bryanesfeo

Untitled

Jul 12th, 2019
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.96 KB | None | 0 0
  1. --https://github.com/Mokiros/roblox-FE-compatibility
  2. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  3. local Player,game,owner = owner,game
  4. local RealPlayer = Player
  5. do
  6. print("FE Compatibility code V2 by Mokiros")
  7. local RealPlayer = RealPlayer
  8. script.Parent = RealPlayer.Character
  9.  
  10. --Fake event to make stuff like Mouse.KeyDown work
  11. local Disconnect_Function = function(this)
  12. this[1].Functions[this[2]] = nil
  13. end
  14. local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}}
  15. local FakeEvent_Metatable = {__index={
  16. Connect = function(this,f)
  17. local i = tostring(math.random(0,10000))
  18. while this.Functions[i] do
  19. i = tostring(math.random(0,10000))
  20. end
  21. this.Functions[i] = f
  22. return setmetatable({this,i},Disconnect_Metatable)
  23. end
  24. }}
  25. FakeEvent_Metatable.__index.connect = FakeEvent_Metatable.__index.Connect
  26. local function fakeEvent()
  27. return setmetatable({Functions={}},FakeEvent_Metatable)
  28. end
  29.  
  30. --Creating fake input objects with fake variables
  31. local FakeMouse = {Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  32. FakeMouse.keyUp = FakeMouse.KeyUp
  33. FakeMouse.keyDown = FakeMouse.KeyDown
  34. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  35. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  36. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  37. end}
  38. --Merged 2 functions into one by checking amount of arguments
  39. CAS.UnbindAction = CAS.BindAction
  40.  
  41. --This function will trigger the events that have been :Connect()'ed
  42. local function TriggerEvent(self,ev,...)
  43. for _,f in pairs(self[ev].Functions) do
  44. f(...)
  45. end
  46. end
  47. FakeMouse.TriggerEvent = TriggerEvent
  48. UIS.TriggerEvent = TriggerEvent
  49.  
  50. --Client communication
  51. local Event = Instance.new("RemoteEvent")
  52. Event.Name = "UserInput_Event"
  53. Event.OnServerEvent:Connect(function(plr,io)
  54. if plr~=RealPlayer then return end
  55. FakeMouse.Target = io.Target
  56. FakeMouse.Hit = io.Hit
  57. if not io.isMouse then
  58. local b = io.UserInputState == Enum.UserInputState.Begin
  59. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  60. return FakeMouse:TriggerEvent(b and "Button1Down" or "Button1Up")
  61. end
  62. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  63. return FakeMouse:TriggerEvent(b and "Button2Down" or "Button2Up")
  64. end
  65. for _,t in pairs(CAS.Actions) do
  66. for _,k in pairs(t.Keys) do
  67. if k==io.KeyCode then
  68. t.Function(t.Name,io.UserInputState,io)
  69. end
  70. end
  71. end
  72. FakeMouse:TriggerEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  73. UIS:TriggerEvent(b and "InputBegan" or "InputEnded",io,false)
  74. end
  75. end)
  76. Event.Parent = NLS([==[local Event = script:WaitForChild("UserInput_Event")
  77. local Mouse = owner:GetMouse()
  78. local UIS = game:GetService("UserInputService")
  79. local input = function(io,RobloxHandled)
  80. if RobloxHandled then return end
  81. --Since InputObject is a client-side instance, we create and pass table instead
  82. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  83. end
  84. UIS.InputBegan:Connect(input)
  85. UIS.InputEnded:Connect(input)
  86. local h,t
  87. --Give the server mouse data every second frame, but only if the values changed
  88. --If player is not moving their mouse, client won't fire events
  89. local HB = game:GetService("RunService").Heartbeat
  90. while true do
  91. if h~=Mouse.Hit or t~=Mouse.Target then
  92. h,t=Mouse.Hit,Mouse.Target
  93. Event:FireServer({isMouse=true,Target=t,Hit=h})
  94. end
  95. --Wait 2 frames
  96. for i=1,2 do
  97. HB:Wait()
  98. end
  99. end]==],script)
  100.  
  101. ----Sandboxed game object that allows the usage of client-side methods and services
  102. --Real game object
  103. local RealGame = game
  104.  
  105. --Metatable for fake service
  106. local FakeService_Metatable = {
  107. __index = function(self,k)
  108. local s = rawget(self,"_RealService")
  109. if s then
  110. return typeof(s[k])=="function"
  111. and function(_,...)return s[k](s,...)end or s[k]
  112. end
  113. end,
  114. __newindex = function(self,k,v)
  115. local s = rawget(self,"_RealService")
  116. if s then s[k]=v end
  117. end
  118. }
  119. local function FakeService(t,RealService)
  120. t._RealService = typeof(RealService)=="string" and RealGame:GetService(RealService) or RealService
  121. return setmetatable(t,FakeService_Metatable)
  122. end
  123.  
  124. --Fake game object
  125. local FakeGame = {
  126. GetService = function(self,s)
  127. return rawget(self,s) or RealGame:GetService(s)
  128. end,
  129. Players = FakeService({
  130. LocalPlayer = FakeService({GetMouse=function(self)return FakeMouse end},Player)
  131. },"Players"),
  132. UserInputService = FakeService(UIS,"UserInputService"),
  133. ContextActionService = FakeService(CAS,"ContextActionService"),
  134. RunService = FakeService({
  135. _btrs = {},
  136. RenderStepped = RealGame:GetService("RunService").Heartbeat,
  137. BindToRenderStep = function(self,name,_,fun)
  138. self._btrs[name] = self.Heartbeat:Connect(fun)
  139. end,
  140. UnbindFromRenderStep = function(self,name)
  141. self._btrs[name]:Disconnect()
  142. end,
  143. },"RunService")
  144. }
  145. rawset(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer)
  146. FakeGame.service = FakeGame.GetService
  147. FakeService(FakeGame,game)
  148. --Changing owner to fake player object to support owner:GetMouse()
  149. game,owner = FakeGame,FakeGame.Players.LocalPlayer
  150. end
  151.  
  152. -- doomguy script
  153. -- made by SLIVER9230
  154. -- go crazy
  155. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  156. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  157. do
  158. print("so uh,blood an gore warnign bitchhhh")
  159. script.Parent = Player.Character
  160.  
  161. --RemoteEvent for communicating
  162. local Event = Instance.new("RemoteEvent")
  163. Event.Name = "UserInput_Event"
  164.  
  165. --Fake event to make stuff like Mouse.KeyDown work
  166. local function fakeEvent()
  167. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  168. t.connect = t.Connect
  169. return t
  170. end
  171.  
  172. --Creating fake input objects with fake variables
  173. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  174. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  175. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  176. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  177. end}
  178. --Merged 2 functions into one by checking amount of arguments
  179. CAS.UnbindAction = CAS.BindAction
  180.  
  181. --This function will trigger the events that have been :Connect()'ed
  182. local function te(self,ev,...)
  183. local t = m[ev]
  184. if t and t._fakeEvent and t.Function then
  185. t.Function(...)
  186. end
  187. end
  188. m.TrigEvent = te
  189. UIS.TrigEvent = te
  190.  
  191. Event.OnServerEvent:Connect(function(plr,io)
  192. if plr~=Player then return end
  193. if io.isMouse then
  194. m.Target = io.Target
  195. m.Hit = io.Hit
  196. else
  197. local b = io.UserInputState == Enum.UserInputState.Begin
  198. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  199. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  200. end
  201. for _,t in pairs(CAS.Actions) do
  202. for _,k in pairs(t.Keys) do
  203. if k==io.KeyCode then
  204. t.Function(t.Name,io.UserInputState,io)
  205. end
  206. end
  207. end
  208. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  209. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  210. end
  211. end)
  212. Event.Parent = NLS([==[
  213. local Player = game:GetService("Players").LocalPlayer
  214. local Event = script:WaitForChild("UserInput_Event")
  215.  
  216. local UIS = game:GetService("UserInputService")
  217. local input = function(io,a)
  218. if a then return end
  219. --Since InputObject is a client-side instance, we create and pass table instead
  220. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  221. end
  222. UIS.InputBegan:Connect(input)
  223. UIS.InputEnded:Connect(input)
  224.  
  225. local Mouse = Player:GetMouse()
  226. local h,t
  227. --Give the server mouse data 30 times every second, but only if the values changed
  228. --If player is not moving their mouse, client won't fire events
  229. while wait(1/30) do
  230. if h~=Mouse.Hit or t~=Mouse.Target then
  231. h,t=Mouse.Hit,Mouse.Target
  232. Event:FireServer({isMouse=true,Target=t,Hit=h})
  233. end
  234. end]==],Player.Character)
  235. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  236. end
  237. wait(0.1)
  238. local mosic = Instance.new("Sound",workspace)
  239. mosic.SoundId = "rbxassetid://1150867044"
  240. mosic.Looped = true
  241. mosic:Play()
  242. mosic.Volume = 0.5
  243. local p = owner
  244. local char = p.Character
  245. local movy = 0
  246. local rev = Instance.new("ReverbSoundEffect",mosic)
  247. rev.WetLevel = 15
  248. rev.DecayTime = 7.065
  249. rev.DryLevel = 20
  250.  
  251. local timee = 0
  252. local keydown = 0
  253. local bang = 0
  254. char.Humanoid.WalkSpeed = 30
  255. local DoomUi = Instance.new("ScreenGui")
  256. local ImageLabel2 = Instance.new("ImageLabel")
  257. mouse.Icon = "http://www.roblox.com/asset/?id=409468479"
  258. DoomUi.Name = "DoomUi"
  259. DoomUi.Parent = p.PlayerGui
  260. DoomUi.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  261.  
  262. ImageLabel2.Parent = DoomUi
  263. ImageLabel2.BackgroundColor3 = Color3.new(1, 1, 1)
  264. ImageLabel2.BackgroundTransparency = 1
  265. ImageLabel2.Position = UDim2.new(0.423069268, -30, 0.662924349, 0)
  266. ImageLabel2.Size = UDim2.new(0, 192, 0, 245)
  267. ImageLabel2.Image = "rbxassetid://155328204"
  268.  
  269. p.CameraMode = "LockFirstPerson"
  270. mouse.KeyDown:connect(function(k)
  271. if k == "w" then
  272. movy = 1
  273. keydown = keydown + 1
  274. end
  275. if k == "s" then
  276. movy = 1
  277. keydown = keydown + 1
  278. end
  279. if k == "a" then
  280. movy = 1
  281. keydown = keydown + 1
  282. end
  283. if k == "d" then
  284. movy = 1
  285. keydown = keydown + 1
  286. end
  287. end)
  288. mouse.Button1Down:connect(function()
  289. local target = mouse.Target
  290. if target.Name == "GlassTrig" then
  291. target.InstaTrig.Disabled = false
  292. target.Script:Destroy()
  293. end
  294. if target.Parent:WaitForChild("Humanoid",0.1) then
  295. if target.Name ~= "Head" then
  296. target.Velocity = Vector3.new(math.random(-20,20),math.random(-20,20),math.random(-20,20))
  297. target.Parent:WaitForChild("Humanoid",0.1).Health = mouse.Target.Parent:WaitForChild("Humanoid",0.1).Health - 50
  298. else
  299. target.Velocity = Vector3.new(math.random(-40,50),math.random(20,30),math.random(-40,40))
  300. target.Parent:WaitForChild("Humanoid",0.1).Health = mouse.Target.Parent:WaitForChild("Humanoid",0.1).Health - 70
  301. end
  302. local bl = Instance.new("ParticleEmitter",mouse.Target)
  303. bl.Name = "blood"
  304. bl.Color = ColorSequence.new(Color3.fromRGB(255,0,0))
  305. bl.Size = NumberSequence.new(0.7,5)
  306. bl.Acceleration = Vector3.new(0,-49,0)
  307. bl.Rate = 390
  308. bl.Speed = NumberRange.new(5,20)
  309. bl.SpreadAngle = Vector2.new(80,80)
  310. bl.Texture = "rbxassetid://785035165"
  311. for i = 1,math.random(10,20) do
  312. local bloodpart = Instance.new("Part",workspace)
  313. local num = math.random(1,2)
  314. bloodpart.Size = Vector3.new(0.1,num,num)
  315. bloodpart.Shape = Enum.PartType.Cylinder
  316. bloodpart.CFrame = target.CFrame * CFrame.new(math.random(-1,1),math.random(-1,1),math.random(-1,1))
  317. bloodpart.Material = "SmoothPlastic"
  318. bloodpart.Velocity = Vector3.new(math.random(-30,30),math.random(12,35),math.random(-30,30))
  319. bloodpart.BrickColor = BrickColor.new("Maroon")
  320. end
  321. end
  322. local ligh = Instance.new("PointLight",char.Torso)
  323. ligh.Color = Color3.fromRGB(255, 223, 142)
  324. ligh.Brightness = "25.24"
  325. ligh.Range = 8
  326. local ImageLabel = Instance.new("ImageLabel")
  327. bang = 1
  328. ImageLabel.Parent = DoomUi
  329. ImageLabel.BackgroundColor3 = Color3.new(1, 1, 1)
  330. ImageLabel.BackgroundTransparency = 1
  331. ImageLabel.Position = UDim2.new(0.266489582, 0, 0.310410094, 0)
  332. ImageLabel.Size = UDim2.new(0, 443, 0, 443)
  333. ImageLabel.ZIndex = -1
  334. ImageLabel.Image = "http://www.roblox.com/asset/?id=203940770"
  335. local pew = Instance.new("Sound",char.Torso)
  336. pew.SoundId = "rbxassetid://2723750380"
  337. pew.Volume = 4
  338. pew:Play()
  339.  
  340. wait(0.1)
  341. ligh:Destroy()
  342. if target.Parent:WaitForChild("Humanoid",0.1) and target.Parent:WaitForChild("Torso",0.1) then
  343. target.blood.Enabled = false
  344. end
  345. ImageLabel:Destroy()
  346.  
  347.  
  348. bang = 0
  349. ImageLabel2:TweenPosition(UDim2.new(0.423, -30,0.663, 0),'InOut','Quad',0.1)
  350. ImageLabel2.ImageColor3 = Color3.fromRGB(255, 255, 255)
  351. wait(4.5)
  352.  
  353. pew:Destroy()
  354. if target.Parent:WaitForChild("Humanoid",0.1) and target then
  355. target.blood:Destroy()
  356. end
  357. end)
  358. mouse.KeyUp:connect(function(k)
  359. if k == "w" and keydown == 1 then
  360. movy = 0
  361. timee = 0
  362. keydown = keydown - 1
  363. end
  364. if k == "a" and keydown == 1 then
  365. movy = 0
  366. timee = 0
  367. keydown = keydown - 1
  368. end
  369. if k == "s" and keydown == 1 then
  370. movy = 0
  371. timee = 0
  372. keydown = keydown - 1
  373. end
  374. if k == "d" and keydown == 1 then
  375. movy = 0
  376. timee = 0
  377. keydown = keydown - 1
  378. end
  379. if k == "w" and keydown == 2 then
  380.  
  381. keydown = keydown - 1
  382. end
  383. if k == "a" and keydown == 2 then
  384.  
  385. keydown = keydown - 1
  386. end
  387. if k == "s" and keydown == 2 then
  388.  
  389. keydown = keydown - 1
  390. end
  391. if k == "d" and keydown == 2 then
  392. keydown = keydown - 1
  393. end
  394. if k == "w" and keydown == 3 then
  395.  
  396. keydown = keydown - 1
  397. end
  398. if k == "a" and keydown == 3 then
  399.  
  400. keydown = keydown - 1
  401. end
  402. if k == "s" and keydown == 3 then
  403.  
  404. keydown = keydown - 1
  405. end
  406. if k == "d" and keydown == 3 then
  407. keydown = keydown - 1
  408. end
  409. if k == "w" and keydown == 4 then
  410.  
  411. keydown = keydown - 1
  412. end
  413. if k == "a" and keydown == 4 then
  414.  
  415. keydown = keydown - 1
  416. end
  417. if k == "s" and keydown == 4 then
  418.  
  419. keydown = keydown - 1
  420. end
  421. if k == "d" and keydown == 4 then
  422. keydown = keydown - 1
  423. end
  424. end)
  425. while wait() do
  426. if movy == 1 and bang ==0 then
  427. timee = timee + 1
  428. 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)
  429. end
  430. if movy == 0 and bang ==0 then
  431. ImageLabel2:TweenPosition(UDim2.new(0.423, -30,0.663, 0),'InOut','Quad',0.3)
  432. end
  433. if bang == 1 then
  434. ImageLabel2:TweenPosition(UDim2.new(0.423, -30,0.763, 0),'Out','Quad',0.1)
  435. ImageLabel2.ImageColor3 = Color3.fromRGB(255, 206, 157)
  436. end
  437. end
Advertisement
Add Comment
Please, Sign In to add comment