Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --<insert credit here that will be deleted anyway>
- --Converted string size:242
- local Scripts = {function() wait(1)
- local sp = script.Parent
- local cam = sp.Camera
- local gui = sp.Part.SurfaceGui
- --[[
- local function pixelAt(c3,x,y)
- local f = Instance.new("Frame",gui)
- f.Size = UDim2.new(0,1,0,1)
- f.BorderSizePixel = 0
- f.BackgroundColor3 = c3
- f.Position = UDim2.new(0,x,0,y)
- return f
- end
- ]]
- local function sl(a,n) --Shift left by n bytes
- return math.floor(a*(2^n))
- end
- local function sr(a,n) --Shift right by n bytes
- return math.floor(a/(2^n))
- end
- local Colors = {}
- local Pixels = setmetatable({},{
- __index=
- function(self,i)
- local t = {}
- self[i] = t
- return t
- end
- })
- local function FindOrInsert(t,c)
- for i,v in pairs(t) do if v==c then return i end end
- table.insert(t,c)
- return #t
- end
- local function c3val(c3)
- return sl(c3.r*255,16)+sl(c3.g*255,8)+math.floor(c3.b*255)
- end
- local function valtoc3(int)
- return Color3.fromRGB(sr(int,16),sr(int,8)%256,int%256)
- end
- local function pixelAt(c3,x,y)
- local i = FindOrInsert(Colors,c3val(c3))
- Pixels[y][x] = i
- end
- local function rayColor(ray)
- local hit,pos,normal = workspace:FindPartOnRay(ray,sp)
- local distance = (ray.Origin-pos).magnitude
- if hit then
- -- local p = Instance.new("Part")
- -- p.Anchored = true
- -- p.CanCollide = false
- -- p.Size = Vector3.new(0.05, 0.05, distance)
- -- p.CFrame = CFrame.new(ray.Origin, pos) * CFrame.new(0, 0, -distance / 2)
- -- p.Parent = sp
- return hit.Color
- else
- return Color3.new(0,0,0)
- end
- end
- local cs = gui.CanvasSize
- local t = tick()
- for y=0,cs.Y-1 do
- --wait()
- for x=0,cs.X-1 do
- local a,b = ((x/(cs.X-1))*2)-1,((y/(cs.Y-1))*-2)+1
- local v = (cam.CFrame*CFrame.new(a*5,b*5,5)).p
- local ray = Ray.new(cam.CFrame.p,(cam.CFrame.p-v).Unit*100)
- local c3 = rayColor(ray)
- pixelAt(c3,cs.X-1-x,cs.Y-1-y)
- end
- end
- print(tick()-t)
- local str = ""
- local lastint = -1
- local n = -1
- local aa=0
- local function addNum(n)
- str = str..string.char(n)
- end
- for y=0,cs.Y-1 do
- for x=0,cs.X-1 do
- local i = Pixels[y][x]
- aa=aa+1
- if i~=lastint and lastint~=-1 or n>254 then
- addNum(lastint)
- addNum(n)
- --print(n)
- n = 0
- end
- n = n+1
- lastint = i
- end
- end
- print(aa,cs.X*cs.Y)
- local x,y = -1,0
- print(#str)
- aa=0
- for i=1,#str,2 do
- local clr,n = Colors[string.byte(str:sub(i,i))],string.byte(str:sub(i+1,i+1))
- aa=aa+n
- --print(n)
- for i=1,n do
- x = x+1
- if x>=cs.X then
- x=x-cs.X
- y=y+1
- end
- local f = Instance.new("Frame",gui)
- f.Size = UDim2.new(0,1,0,1)
- f.BackgroundColor3 = valtoc3(clr)
- f.BorderSizePixel = 0
- f.Position = UDim2.new(0,x,0,y)
- end
- end
- print(aa) end;}
- local ActualScripts = {}
- function s(var)
- local func = table.remove(Scripts,1)
- local env = getfenv(func)
- local newenv = setmetatable({},{
- __index = function(self,k)
- if k=="script" then
- return var
- else
- return env[k]
- end
- end,
- })
- setfenv(func,newenv)
- table.insert(ActualScripts,coroutine.wrap(func))
- end
- function Decode(a,b,c,d,e,f,g,h,i,j)local k,l,m,n,o,p=tonumber,table.remove,table.foreach,Instance.new,"Parent",","i=function(a,q,r)r={}a:gsub(("([^%s]+)"):format(q),function(t)r[#r+1]=t end)return r end;j=function(b)return i(l(b,1),p)end;b=i(a,";")c=j(b)d=j(b)e=j(b)f=n"Model"g=f;m(b,function(u,t)if t=="n"or t=="p"then g=t=="n"and h or g[o]else u=i(t,"|")h=n(d[k(l(u,1))])if h:IsA"BasePart"then h.Anchored=true;h.Locked=true elseif h:IsA"Script"then s(h)end;m(u,function(s,v,w,a)w=v:find":"v,a=c[k(v:sub(1,w-1))],v:sub(w+1)function w(w)return unpack(i(w,p))end;s=#i(a,p)h[v]=v=="Name"and e[k(a)]or(v=="Color"or v:sub(#v-5)=="Color3")and s==3 and Color3.new(w(a))or s==4 and UDim2.new(w(a))or s==3 and Vector3.new(w(a))or s==2 and Vector2.new(w(a))or s==12 and CFrame.new(w(a))or k(a)or a~="true"and a~="false"and a or a=="true"end)h[o]=g end end)return f end
- local Model = Decode([==[Name,Color,Position,Orientation,Size,Face,ClipsDescendants,CanvasSize;Part,SurfaceGui,Script;Camera;1|1:1|2:0.067,0.067,0.067|3:25,5,-47|4:0,180,0|5:2,2,2;1|2:0.973,0.973,0.973|3:25,5,-48.5|4:0,180,0|5:10,10,1;n;2|6:Back|7:true|8:100,100;p;3;]==])
- Model.Parent = script.Parent==workspace and script or workspace
- for _,f in pairs(ActualScripts) do f() end
Advertisement
Add Comment
Please, Sign In to add comment