TheYoutuber_Pro

Untitled

Jan 16th, 2022
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; 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.     --RemoteEvent for communicating
  9.     local Event = Instance.new("RemoteEvent")
  10.     Event.Name = "UserInput_Event"
  11.  
  12.     --Fake event to make stuff like Mouse.KeyDown work
  13.     local function fakeEvent()
  14.         local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
  15.         t.connect = t.Connect
  16.         return t
  17.     end
  18.  
  19.     --Creating fake input objects with fake variables
  20.     local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  21.     local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  22.     local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  23.         CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  24.     end}
  25.     --Merged 2 functions into one by checking amount of arguments
  26.     CAS.UnbindAction = CAS.BindAction
  27.  
  28.     --This function will trigger the events that have been :Connect()'ed
  29.     local function te(self,ev,...)
  30.         local t = m[ev]
  31.         if t and t._fakeEvent then
  32.             for _,f in pairs(t.Functions) do
  33.                 f(...)
  34.             end
  35.         end
  36.     end
  37.     m.TrigEvent = te
  38.     UIS.TrigEvent = te
  39.  
  40.     Event.OnServerEvent:Connect(function(plr,io)
  41.         if plr~=rp then return end
  42.         m.Target = io.Target
  43.         m.Hit = io.Hit
  44.         if not io.isMouse then
  45.             local b = io.UserInputState == Enum.UserInputState.Begin
  46.             if io.UserInputType == Enum.UserInputType.MouseButton1 then
  47.                 return m:TrigEvent(b and "Button1Down" or "Button1Up")
  48.             end
  49.             if io.UserInputType == Enum.UserInputType.MouseButton2 then
  50.                 return m:TrigEvent(b and "Button2Down" or "Button2Up")
  51.             end
  52.             for _,t in pairs(CAS.Actions) do
  53.                 for _,k in pairs(t.Keys) do
  54.                     if k==io.KeyCode then
  55.                         t.Function(t.Name,io.UserInputState,io)
  56.                     end
  57.                 end
  58.             end
  59.             m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  60.             UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  61.         end
  62.     end)
  63.     Event.Parent = NLS([==[
  64.     local Player = game:GetService("Players").LocalPlayer
  65.     local Event = script:WaitForChild("UserInput_Event")
  66.  
  67.     local Mouse = Player:GetMouse()
  68.     local UIS = game:GetService("UserInputService")
  69.     local input = function(io,a)
  70.         if a then return end
  71.         --Since InputObject is a client-side instance, we create and pass table instead
  72.         Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  73.     end
  74.     UIS.InputBegan:Connect(input)
  75.     UIS.InputEnded:Connect(input)
  76.  
  77.     local h,t
  78.     --Give the server mouse data 30 times every second, but only if the values changed
  79.     --If player is not moving their mouse, client won't fire events
  80.     while wait(1/30) do
  81.         if h~=Mouse.Hit or t~=Mouse.Target then
  82.             h,t=Mouse.Hit,Mouse.Target
  83.             Event:FireServer({isMouse=true,Target=t,Hit=h})
  84.         end
  85.     end]==],Player.Character)
  86.  
  87.     ----Sandboxed game object that allows the usage of client-side methods and services
  88.     --Real game object
  89.     local _rg = game
  90.  
  91.     --Metatable for fake service
  92.     local fsmt = {
  93.         __index = function(self,k)
  94.             local s = rawget(self,"_RealService")
  95.             if s then
  96.                 return typeof(s[k])=="function"
  97.                 and function(_,...)return s[k](s,...)end or s[k]
  98.             end
  99.         end,
  100.         __newindex = function(self,k,v)
  101.             local s = rawget(self,"_RealService")
  102.             if s then s[k]=v end
  103.         end
  104.     }
  105.     local function FakeService(t,RealService)
  106.         t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  107.         return setmetatable(t,fsmt)
  108.     end
  109.  
  110.     --Fake game object
  111.     local g = {
  112.         GetService = function(self,s)
  113.             return rawget(self,s) or _rg:GetService(s)
  114.         end,
  115.         Players = FakeService({
  116.             LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  117.         },"Players"),
  118.         UserInputService = FakeService(UIS,"UserInputService"),
  119.         ContextActionService = FakeService(CAS,"ContextActionService"),
  120.         RunService = FakeService({
  121.             _btrs = {},
  122.             RenderStepped = _rg:GetService("RunService").Heartbeat,
  123.             BindToRenderStep = function(self,name,_,fun)
  124.                 self._btrs[name] = self.Heartbeat:Connect(fun)
  125.             end,
  126.             UnbindFromRenderStep = function(self,name)
  127.                 self._btrs[name]:Disconnect()
  128.             end,
  129.         },"RunService")
  130.     }
  131.     rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  132.     g.service = g.GetService
  133.     FakeService(g,game)
  134.     --Changing owner to fake player object to support owner:GetMouse()
  135.     game,owner = g,g.Players.LocalPlayer
  136. end
  137.  
  138. wait(1)
  139. math.randomseed(tick() % 1 * 1e6)
  140. sky = coroutine.create(function()
  141.     while wait(0.3) do
  142.         s = Instance.new("Sky",game.Lighting)
  143.         s.SkyboxBk,s.SkyboxDn,s.SkyboxFt,s.SkyboxLf,s.SkyboxRt,s.SkyboxUp = "rbxassetid://201208408","rbxassetid://201208408","rbxassetid://201208408","rbxassetid://201208408","rbxassetid://201208408","rbxassetid://201208408"
  144.         s.CelestialBodiesShown = false
  145.     end
  146. end)
  147.  
  148.  
  149. del = coroutine.create(function()
  150.     while wait(0.3) do
  151.         for i,v in pairs(workspace:GetChildren()) do
  152.             if v:IsA("Model") then
  153.                 v:Destroy()
  154.             end
  155.         end
  156.     end
  157. end)
  158.  
  159.  
  160.  
  161. for i,v in pairs(game.Players:GetChildren()) do
  162. end
  163.  
  164. noises = {'rbxassetid://230287740','rbxassetid://271787597','rbxassetid://153752123','rbxassetid://271787503'}
  165.  
  166. sound = coroutine.create(function()
  167.     a = Instance.new("Sound",workspace)
  168.     a.SoundId = "rbxassetid://902601313"
  169.     a.Name = "RAINING MEN"
  170.     a.Volume = 58359
  171.     a.Looped = true
  172.     a:Play()
  173.     while wait(0.2) do
  174.         rainin = workspace:FindFirstChild("RAINING MEN")
  175.         if not rainin then
  176.             a = Instance.new("Sound",workspace)
  177.             a.SoundId = "rbxassetid://902601313"
  178.             a.Name = "RAINING MEN"
  179.             a.Volume = 58359
  180.             a.Looped = true
  181.             a:Play()
  182.         end
  183.     end
  184. end)
  185.  
  186. msg = coroutine.create(function()
  187.     while wait(0.4) do
  188.         msg = Instance.new("Message",workspace)
  189.         msg.Text = "Get toadroasted you bacon-haired bozos. (GO QUIT FUCKED SHIT NIGGER XD FELIXMAYERKIDS IS A HACKER)"
  190.         wait(0.4)
  191.         msg:Destroy()
  192.     end
  193. end)
  194.  
  195.  
  196. rain = coroutine.create(function()
  197.     while wait(10 % 1 * 1e2) do
  198.         part = Instance.new("Part",workspace)
  199.         part.Name = "Toad"
  200.        
  201.         mesh = Instance.new("SpecialMesh",part)
  202.        
  203.         sound = Instance.new("Sound",workspace)
  204.        
  205.         part.CanCollide = false
  206.         part.Size = Vector3.new(440,530,380)
  207.         part.Position = Vector3.new(math.random(-3000,1000),math.random(1,3000),math.random(-3000,3000))
  208.    
  209.         sound.SoundId = noises[math.random(1,#noises)]
  210.         sound:Play()
  211.         sound.Ended:connect(function()
  212.             sound:Destroy()
  213.         end)
  214.        
  215.        
  216.         mesh.MeshType = "FileMesh"
  217.         mesh.MeshId = "rbxassetid://430210147"
  218.         mesh.TextureId = "rbxassetid://430210159"
  219.     end
  220. end)
  221. coroutine.resume(sky)
  222. coroutine.resume(del)
  223. coroutine.resume(sound)
  224. coroutine.resume(msg)
  225. coroutine.resume(rain)
Add Comment
Please, Sign In to add comment