Advertisement
AxeuerAlt

Lighting Real Time

Jan 26th, 2020
297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.08 KB | None | 0 0
  1. -- Converted using Mokiros's Model to Script plugin
  2. -- Converted string size: 64
  3. local _in_f=Instance.new local Instance = {new=function(cn,p)
  4. local i,a,b=0 repeat i=i+1 a,b=pcall(_in_f,cn,p)if not a then warn(b)wait(math.min(i,5))end until a return b end}
  5.  
  6. local Scripts = {
  7. function() local a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,ab,bb,cb,db,eb,fb,gb,hb,ib,jb,kb,lb,mb,nb,ob,pb=_G,_VERSION,assert,collectgarbage,dofile,error,getfenv,getmetatable,ipairs,load,loadfile,loadstring,next,pairs,pcall,print,rawequal,rawget,rawset,select,setfenv,setmetatable,tonumber,tostring,type,unpack,xpcall,coroutine,math,string,table,game,Game,workspace,Workspace,delay,Delay,LoadLibrary,printidentity,Spawn,tick,time,version,Version,Wait,wait,PluginManager,crash__,LoadRobloxLibrary,settings,Stats,stats,UserSettings,Enum,Color3,BrickColor,Vector2,Vector3,Vector3int16,CFrame,UDim,UDim2,Ray,Axes,Faces,Instance,Region3,Region3int16 C.randomseed(O())local qb=G:GetService('Lighting')local function rb()local sb="%.2d:%.2d:%.2d"local tb=O()return sb:format(C.floor((tb/3600)%24),C.floor((tb/60)%60),C.floor((tb%60)))end while true do qb.TimeOfDay=rb()T(1)end end;
  8. function() local a=Instance.new("Hint")while true do a.Parent=game.Workspace a.Text="Real Life Sun/Moon Time Loaded For Roblox Lighting Time."wait(10)a:Remove()end end;}
  9. local ActualScripts = {}
  10. function s(var)
  11. local func = table.remove(Scripts,1)
  12. setfenv(func,setmetatable({script=var},{
  13. __index = getfenv(func),
  14. }))
  15. table.insert(ActualScripts,coroutine.wrap(func))
  16. end
  17.  
  18. local Decode = function(str,t,props,classes,values,ICList,Model,CurPar,LastIns,split,RemoveAndSplit,InstanceList)
  19. local tonum,table_remove,inst,parnt,comma,table_foreach = tonumber,table.remove,Instance.new,"Parent",",",
  20. function(t,f)
  21. for a,b in pairs(t) do
  22. f(a,b)
  23. end
  24. end
  25. local Types = {
  26. Color3 = Color3.new,
  27. Vector3 = Vector3.new,
  28. Vector2 = Vector2.new,
  29. UDim = UDim.new,
  30. UDim2 = UDim2.new,
  31. CFrame = CFrame.new,
  32. Rect = Rect.new,
  33. NumberRange = NumberRange.new,
  34. NumberSequence = function(...)
  35. local a = {...}
  36. local t = {}
  37. repeat
  38. t[#t+1] = NumberSequenceKeypoint.new(table_remove(a,1),table_remove(a,1),table_remove(a,1))
  39. until #a==0
  40. return NumberSequence.new(t)
  41. end,
  42. ColorSequence = function(...)
  43. local a = {...}
  44. local t = {}
  45. repeat
  46. t[#t+1] = ColorSequenceKeypoint.new(table_remove(a,1),Color3.new(table_remove(a,1),table_remove(a,1),table_remove(a,1)))
  47. until #a==0
  48. return ColorSequence.new(t)
  49. end,
  50. number = tonumber,
  51. boolean = function(a)
  52. return a=="1"
  53. end
  54. }
  55. split = function(str,sep)
  56. if not str then return end
  57. local fields = {}
  58. local ConcatNext = false
  59. str:gsub(("([^%s]+)"):format(sep),function(c)
  60. if ConcatNext == true then
  61. fields[#fields] = fields[#fields]..sep..c
  62. ConcatNext = false
  63. else
  64. fields[#fields+1] = c
  65. end
  66. if c:sub(#c)=="\\" then
  67. c = fields[#fields]
  68. fields[#fields] = c:sub(1,#c-1)
  69. ConcatNext = true
  70. end
  71. end)
  72. return fields
  73. end
  74. RemoveAndSplit = function(t)
  75. return split(table_remove(t,1),comma)
  76. end
  77. t = split(str,";")
  78. props = RemoveAndSplit(t)
  79. classes = RemoveAndSplit(t)
  80. values = split(table_remove(t,1),'|')
  81. ICList = RemoveAndSplit(t)
  82. InstanceList = {}
  83. Model = inst"Model"
  84. CurPar = Model
  85. table_foreach(t,function(ct,c)
  86. if c=="n" or c=="p" then
  87. CurPar = c=="n" and LastIns or CurPar[parnt]
  88. else
  89. ct = split(c,"|")
  90. local class = classes[tonum(table_remove(ct,1))]
  91. if class=="UnionOperation" then
  92. LastIns = {Locked="true",Anchored="true",UsePartColor="true"}
  93. else
  94. LastIns = inst(class)
  95. if LastIns:IsA"Script" then
  96. s(LastIns)
  97. end
  98. end
  99.  
  100. local function SetProperty(LastIns,p,str,s)
  101. s = Types[typeof(LastIns[p])]
  102. LastIns[p] = s and s(unpack(split(str,comma))) or str
  103. end
  104.  
  105. local UnionData
  106. table_foreach(ct,function(s,p,a,str)
  107. a = p:find":"
  108. p,str = props[tonum(p:sub(1,a-1))],values[tonum(p:sub(a+1))]
  109. if p=="UnionData" then
  110. UnionData = split(str," ")
  111. return
  112. end
  113. if class=="UnionOperation" then
  114. LastIns[p] = str
  115. return
  116. end
  117. SetProperty(LastIns,p,str)
  118. end)
  119.  
  120. if UnionData then
  121. local LI_Data = LastIns
  122. LastIns = DecodeUnion(UnionData)
  123. table_foreach(LI_Data,function(p,str)
  124. SetProperty(LastIns,p,str)
  125. end)
  126. end
  127. table.insert(InstanceList,LastIns)
  128. LastIns[parnt] = CurPar
  129. end
  130. end)
  131. table_remove(ICList,1)
  132. table_foreach(ICList,function(a,b)
  133. b = split(b,">")
  134. InstanceList[tonum(b[1])][props[tonum(b[2])]] = InstanceList[tonum(b[3])]
  135. end)
  136.  
  137. return Model:GetChildren()
  138. end
  139.  
  140. local Objects = Decode('Name;Part,Script;Part|RealTimeLighting|Loaded;0;2|1:2;n;2|1:3;p;'
  141. ..'')
  142. for _,Object in pairs(Objects) do
  143. Object.Parent = script and script.Parent==workspace and script or workspace
  144. end
  145. for _,f in pairs(ActualScripts) do f() end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement