Advertisement
Infintyboy

oran T0ME

Sep 18th, 2018
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 9.42 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=145825776"
  173. sound2.Volume = 10
  174. sound2.Looped = true
  175. sound2.Parent = Character
  176. sound2.PlayOnRemove = true
  177. sound2:Destroy()
  178. local sound2 = Instance.new("Sound")
  179. sound2.SoundId = "http://www.roblox.com/asset/?id=145825776"
  180. sound2.Volume = 10
  181. sound2.Looped = true
  182. sound2.Parent = Character
  183. sound2.PlayOnRemove = true
  184. sound2:Destroy()
  185. local sound2 = Instance.new("Sound")
  186. sound2.SoundId = "http://www.roblox.com/asset/?id=145825776"
  187. sound2.Volume = 10
  188. sound2.Looped = true
  189. sound2.Parent = Character
  190. sound2.PlayOnRemove = true
  191. sound2:Destroy()
  192. local sound2 = Instance.new("Sound")
  193. sound2.SoundId = "http://www.roblox.com/asset/?id=145825776"
  194. sound2.Volume = 10
  195. sound2.Looped = true
  196. sound2.Parent = Character
  197. sound2.PlayOnRemove = true
  198. sound2:Destroy()
  199. local sound2 = Instance.new("Sound")
  200. sound2.SoundId = "http://www.roblox.com/asset/?id=145825776"
  201. sound2.Volume = 10
  202. sound2.Looped = true
  203. sound2.Parent = Character
  204. sound2.PlayOnRemove = true
  205. sound2:Destroy()
  206. local sound2 = Instance.new("Sound")
  207. sound2.SoundId = "http://www.roblox.com/asset/?id=145825776"
  208. sound2.Volume = 10
  209. sound2.Looped = true
  210. sound2.Parent = Character
  211. sound2.PlayOnRemove = true
  212. sound2:Destroy()
  213. local sound2 = Instance.new("Sound")
  214. sound2.SoundId = "http://www.roblox.com/asset/?id=145825776"
  215. sound2.Volume = 10
  216. sound2.Looped = true
  217. sound2.Parent = Character
  218. sound2.PlayOnRemove = true
  219. sound2:Destroy()
  220. local sound2 = Instance.new("Sound")
  221. sound2.SoundId = "http://www.roblox.com/asset/?id=145825776"
  222. sound2.Volume = 10
  223. sound2.Looped = true
  224. sound2.Parent = Character
  225. sound2.PlayOnRemove = true
  226. sound2:Destroy()
  227. local sound2 = Instance.new("Sound")
  228. sound2.SoundId = "http://www.roblox.com/asset/?id=145825776"
  229. sound2.Volume = 10
  230. sound2.Looped = true
  231. sound2.Parent = Character
  232. sound2.PlayOnRemove = true
  233. sound2:Destroy()
  234. local sound2 = Instance.new("Sound")
  235. sound2.SoundId = "http://www.roblox.com/asset/?id=145825776"
  236. sound2.Volume = 10
  237. sound2.Looped = true
  238. sound2.Parent = Character
  239. sound2.PlayOnRemove = true
  240. sound2:Destroy()
  241. local sound2 = Instance.new("Sound")
  242. sound2.SoundId = "http://www.roblox.com/asset/?id=145825776"
  243. sound2.Volume = 10
  244. sound2.Looped = true
  245. sound2.Parent = Character
  246. sound2.PlayOnRemove = true
  247. sound2:Destroy()
  248. local sound2 = Instance.new("Sound")
  249. sound2.SoundId = "http://www.roblox.com/asset/?id=145825776"
  250. sound2.Volume = 10
  251. sound2.Looped = true
  252. sound2.Parent = Character
  253. sound2.PlayOnRemove = true
  254. sound2:Destroy()
  255. local sound2 = Instance.new("Sound")
  256. sound2.SoundId = "http://www.roblox.com/asset/?id=145825776"
  257. sound2.Volume = 10
  258. sound2.Looped = true
  259. sound2.Parent = Character
  260. sound2.PlayOnRemove = true
  261. sound2:Destroy()
  262. local sound2 = Instance.new("Sound")
  263. sound2.SoundId = "http://www.roblox.com/asset/?id=145825776"
  264. sound2.Volume = 10
  265. sound2.Looped = true
  266. sound2.Parent = Character
  267. sound2.PlayOnRemove = true
  268. sound2:Destroy()
  269. local sound2 = Instance.new("Sound")
  270. sound2.SoundId = "http://www.roblox.com/asset/?id=145825776"
  271. sound2.Volume = 10
  272. sound2.Looped = true
  273. sound2.Parent = Character
  274. sound2.PlayOnRemove = true
  275. sound2:Destroy()
  276.  
  277.  
  278. hum.MaxHealth = 'inf'
  279. Script0.Parent = Character
  280. hum.Health = 'inf'
  281.  
  282.  
  283. while true do
  284. wait()
  285. script.Name = math.random(100, 100000)..[[ ]]..math.random(100000, 1000000000)
  286. end
  287. end))
  288. for i,v in pairs(mas:GetChildren()) do
  289.     v.Parent = workspace
  290.     pcall(function() v:MakeJoints() end)
  291. end
  292. mas:Destroy()
  293. for i,v in pairs(cors) do
  294.     spawn(function()
  295.         pcall(v)
  296.     end)
  297. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement