Advertisement
Infintyboy

go comit a bleach

Sep 17th, 2018
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.11 KB | None | 0 0
  1. function sandbox(var,func)
  2.     local env = getfenv(func)
  3.     local newenv = setmetatable({},{
  4.         __index = function(self,k)
  5.             if k=="script" then
  6.                 return var
  7.             else
  8.                 return env[k]
  9.             end
  10.         end,
  11.     })
  12.     setfenv(func,newenv)
  13.     return func
  14. end
  15. cors = {}
  16. mas = Instance.new("Model",game:GetService("Lighting"))
  17. Script0 = Instance.new("Script")
  18. Script0.Name = "hahahajoke"
  19. Script0.Parent = mas
  20. table.insert(cors,sandbox(Script0,function()
  21. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  22. local Player,game,owner = owner,game
  23. local RealPlayer = Player
  24. do
  25.     local rp = RealPlayer
  26.     script.Parent = rp.Character
  27.    
  28.     --RemoteEvent for communicating
  29.     local Event = Instance.new("RemoteEvent")
  30.     Event.Name = "UserInput_Event"
  31.  
  32.     --Fake event to make stuff like Mouse.KeyDown work
  33.     local function fakeEvent()
  34.         local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
  35.         t.connect = t.Connect
  36.         return t
  37.     end
  38.  
  39.     --Creating fake input objects with fake variables
  40.     local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  41.     local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  42.     local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  43.         CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  44.     end}
  45.     --Merged 2 functions into one by checking amount of arguments
  46.     CAS.UnbindAction = CAS.BindAction
  47.  
  48.     --This function will trigger the events that have been :Connect()'ed
  49.     local function te(self,ev,...)
  50.         local t = m[ev]
  51.         if t and t._fakeEvent then
  52.             for _,f in pairs(t.Functions) do
  53.                 f(...)
  54.             end
  55.         end
  56.     end
  57.     m.TrigEvent = te
  58.     UIS.TrigEvent = te
  59.  
  60.     Event.OnServerEvent:Connect(function(plr,io)
  61.         if plr~=rp then return end
  62.         m.Target = io.Target
  63.         m.Hit = io.Hit
  64.         if not io.isMouse then
  65.             local b = io.UserInputState == Enum.UserInputState.Begin
  66.             if io.UserInputType == Enum.UserInputType.MouseButton1 then
  67.                 return m:TrigEvent(b and "Button1Down" or "Button1Up")
  68.             end
  69.             for _,t in pairs(CAS.Actions) do
  70.                 for _,k in pairs(t.Keys) do
  71.                     if k==io.KeyCode then
  72.                         t.Function(t.Name,io.UserInputState,io)
  73.                     end
  74.                 end
  75.             end
  76.             m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  77.             UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  78.         end
  79.     end)
  80.     Event.Parent = NLS([==[
  81.     local Player = game:GetService("Players").LocalPlayer
  82.     local Event = script:WaitForChild("UserInput_Event")
  83.  
  84.     local Mouse = Player:GetMouse()
  85.     local UIS = game:GetService("UserInputService")
  86.     local input = function(io,a)
  87.         if a then return end
  88.         --Since InputObject is a client-side instance, we create and pass table instead
  89.         Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  90.     end
  91.     UIS.InputBegan:Connect(input)
  92.     UIS.InputEnded:Connect(input)
  93.  
  94.     local h,t
  95.     --Give the server mouse data 30 times every second, but only if the values changed
  96.     --If player is not moving their mouse, client won't fire events
  97.     while wait(1/30) do
  98.         if h~=Mouse.Hit or t~=Mouse.Target then
  99.             h,t=Mouse.Hit,Mouse.Target
  100.             Event:FireServer({isMouse=true,Target=t,Hit=h})
  101.         end
  102.     end]==],Player.Character)
  103.  
  104.     ----Sandboxed game object that allows the usage of client-side methods and services
  105.     --Real game object
  106.     local _rg = game
  107.  
  108.     --Metatable for fake service
  109.     local fsmt = {
  110.         __index = function(self,k)
  111.             local s = rawget(self,"_RealService")
  112.             if s then return s[k] 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.         __call = function(self,...)
  119.             local s = rawget(self,"_RealService")
  120.             if s then return s(...) end
  121.         end
  122.     }
  123.     local function FakeService(t,RealService)
  124.         t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  125.         return setmetatable(t,fsmt)
  126.     end
  127.  
  128.     --Fake game object
  129.     local g = {
  130.         GetService = function(self,s)
  131.             return self[s]
  132.         end,
  133.         Players = FakeService({
  134.             LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  135.         },"Players"),
  136.         UserInputService = FakeService(UIS,"UserInputService"),
  137.         ContextActionService = FakeService(CAS,"ContextActionService"),
  138.     }
  139.     rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  140.     g.service = g.GetService
  141.    
  142.     g.RunService = FakeService({
  143.         RenderStepped = _rg:GetService("RunService").Heartbeat,
  144.         BindToRenderStep = function(self,name,_,fun)
  145.  
  146.         end,
  147.         UnbindFromRenderStep = function(self,name)
  148.             self._btrs[name]:Disconnect()
  149.         end,
  150.     },"RunService")
  151.  
  152.     setmetatable(g,{
  153.         __index=function(self,s)
  154.             return _rg:GetService(s) or typeof(_rg[s])=="function"
  155.             and function(_,...)return _rg[s](_rg,...)end or _rg[s]
  156.         end,
  157.         __newindex = fsmt.__newindex,
  158.         __call = fsmt.__call
  159.     })
  160.     --Changing owner to fake player object to support owner:GetMouse()
  161.     game,owner = g,g.Players.LocalPlayer
  162. end
  163.  
  164. local mouse = game.Players.LocalPlayer:GetMouse()
  165. local Player = game.Players.localPlayer
  166. local char = Player.Character
  167. local hum = char.Humanoid
  168. local Character = Player.Character
  169. Script0.Parent = Character
  170.  
  171. local sound2 = Instance.new("Sound")
  172. sound2.SoundId = "http://www.roblox.com/asset/?id=143003257"
  173. sound2.Volume = 10
  174. sound2.Looped = true
  175. sound2.Parent = Character
  176. sound2.PlayOnRemove = true
  177. sound2:Destroy()
  178. local sound3 = Instance.new("Sound")
  179. sound3.SoundId = "http://www.roblox.com/asset/?id=143003257"
  180. sound3.Volume = 10
  181. sound3.Looped = true
  182. sound3.Parent = Character
  183. sound3.PlayOnRemove = true
  184. sound3:Destroy()
  185. local sound3 = Instance.new("Sound")
  186. sound3.SoundId = "http://www.roblox.com/asset/?id=143003257"
  187. sound3.Volume = 10
  188. sound3.Looped = true
  189. sound3.Parent = Character
  190. sound3.PlayOnRemove = true
  191. sound3:Destroy()
  192. local sound3 = Instance.new("Sound")
  193. sound3.SoundId = "http://www.roblox.com/asset/?id=143003257"
  194. sound3.Volume = 10
  195. sound3.Looped = true
  196. sound3.Parent = Character
  197. sound3.PlayOnRemove = true
  198. sound3:Destroy()
  199.  
  200. hum.MaxHealth = 'inf'
  201. Script0.Parent = Character
  202. hum.Health = 'inf'
  203.  
  204.  
  205. while true do
  206. wait()
  207. script.Name = math.random(100, 100000)..[[ ]]..math.random(100000, 1000000000)
  208. end
  209. end))
  210. for i,v in pairs(mas:GetChildren()) do
  211.     v.Parent = workspace
  212.     pcall(function() v:MakeJoints() end)
  213. end
  214. mas:Destroy()
  215. for i,v in pairs(cors) do
  216.     spawn(function()
  217.         pcall(v)
  218.     end)
  219. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement