AxeuerAlt

Untitled

May 25th, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.78 KB | None | 0 0
  1. if game:GetService("RunService"):IsClient() then error("use h/ and not hl/") end
  2. local Player,game,owner = owner,game
  3. local RealPlayer = Player
  4. do
  5. local rp = RealPlayer
  6. script.Parent = rp.Character
  7.  
  8. local Event = Instance.new("RemoteEvent")
  9. Event.Name = "UserInput_Event"
  10.  
  11. local function fakeEvent()
  12. local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
  13. t.connect = t.Connect
  14. return t
  15. end
  16.  
  17. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  18. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  19. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  20. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  21. end}
  22. CAS.UnbindAction = CAS.BindAction
  23. local function te(self,ev,...)
  24. local t = m[ev]
  25. if t and t._fakeEvent then
  26. for _,f in pairs(t.Functions) do
  27. f(...)
  28. end
  29. end
  30. end
  31. m.TrigEvent = te
  32. UIS.TrigEvent = te
  33.  
  34. Event.OnServerEvent:Connect(function(plr,io)
  35. if plr~=rp then return end
  36. m.Target = io.Target
  37. m.Hit = io.Hit
  38. if not io.isMouse then
  39. local b = io.UserInputState == Enum.UserInputState.Begin
  40. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  41. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  42. end
  43. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  44. return m:TrigEvent(b and "Button2Down" or "Button2Up")
  45. end
  46. for _,t in pairs(CAS.Actions) do
  47. for _,k in pairs(t.Keys) do
  48. if k==io.KeyCode then
  49. t.Function(t.Name,io.UserInputState,io)
  50. end
  51. end
  52. end
  53. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  54. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  55. end
  56. end)
  57. Event.Parent = NLS([==[
  58. local Player = game:GetService("Players").LocalPlayer
  59. local Event = script:WaitForChild("UserInput_Event")
  60. local Mouse = Player:GetMouse()
  61. local UIS = game:GetService("UserInputService")
  62. local input = function(io,a)
  63. if a then return end
  64. --Since InputObject is a client-side instance, we create and pass table instead
  65. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  66. end
  67. UIS.InputBegan:Connect(input)
  68. UIS.InputEnded:Connect(input)
  69. local h,t
  70. while wait(1/30) do
  71. if h~=Mouse.Hit or t~=Mouse.Target then
  72. h,t=Mouse.Hit,Mouse.Target
  73. Event:FireServer({isMouse=true,Target=t,Hit=h})
  74. end
  75. end]==],Player.Character)
  76.  
  77. local _rg = game
  78.  
  79. local fsmt = {
  80. __index = function(self,k)
  81. local s = rawget(self,"_RealService")
  82. if s then
  83. return typeof(s[k])=="function"
  84. and function(_,...)return s[k](s,...)end or s[k]
  85. end
  86. end,
  87. __newindex = function(self,k,v)
  88. local s = rawget(self,"_RealService")
  89. if s then s[k]=v end
  90. end
  91. }
  92. local function FakeService(t,RealService)
  93. t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  94. return setmetatable(t,fsmt)
  95. end
  96. local g = {
  97. GetService = function(self,s)
  98. return rawget(self,s) or _rg:GetService(s)
  99. end,
  100. Players = FakeService({
  101. LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  102. },"Players"),
  103. UserInputService = FakeService(UIS,"UserInputService"),
  104. ContextActionService = FakeService(CAS,"ContextActionService"),
  105. RunService = FakeService({
  106. _btrs = {},
  107. RenderStepped = _rg:GetService("RunService").Heartbeat,
  108. BindToRenderStep = function(self,name,_,fun)
  109. self._btrs[name] = self.Heartbeat:Connect(fun)
  110. end,
  111. UnbindFromRenderStep = function(self,name)
  112. self._btrs[name]:Disconnect()
  113. end,
  114. },"RunService")
  115. }
  116. rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  117. g.service = g.GetService
  118. FakeService(g,game)
  119. game,owner = g,g.Players.LocalPlayer
  120. local player=game:service'Players'.LocalPlayer
  121. local char=player.Character
  122. MainFrameStart = Instance.new("Sound",char)
  123. MainFrameStart.Volume = 4
  124. MainFrameStart.Looped = false
  125. MainFrameStart.SoundId = "rbxassetid://1447883095"
  126. MainFrameStart:Play()
  127. MainFrameStart.Ended:Wait()
  128. MainFrameStart = Instance.new("Sound",char)
  129. MainFrameStart.Volume = 50
  130. MainFrameStart.Looped = false
  131. MainFrameStart.SoundId = "rbxassetid://151514610"
  132. MainFrameStart:Play()
  133. wait(34)
  134. MainFrameStart:Stop()
  135. MainFrameStart = Instance.new("Sound",char)
  136. MainFrameStart.Volume = 50
  137. MainFrameStart.Looped = false
  138. MainFrameStart.SoundId = "rbxassetid://256286242"
  139. MainFrameStart:Play()
  140. MainFrameStart.Ended:Wait()
  141. Countdown = 120
  142.  
  143.  
  144.  
  145. Count = Countdown
  146. local m = Instance.new("Hint", game.Workspace)
  147. while true do
  148. if Countdown == 0 then
  149. Countdown = Count
  150. else m.Text = "Evacuate!!! "..Countdown
  151. wait(1)
  152. Countdown = Countdown - 1
  153.  
  154.  
  155. Countdown = 0
  156. MainFrameStart = Instance.new("Sound",char)
  157. MainFrameStart.Volume = 50
  158. MainFrameStart.Looped = false
  159. MainFrameStart.SoundId = "rbxassetid://569900517"
  160. MainFrameStart:Play()
  161. MainFrameStart.Ended:Wait()
  162.  
  163. if m.Text == "Evacuate!!! 1" then
  164. m:remove()
  165. end
  166. end
  167. end
  168. end
Add Comment
Please, Sign In to add comment