Here is a better example of an obfuscated code that prints “test”:
local a=string.sub;local b=string.byte;local c=string.char;local d=unpack;local e=getfenv or function()return _ENV end;local f=tonumber;local g=tostring;local h=pairs;local i=ipairs;local j=table.concat;local k;local function l(m,n)if not m then return end;local o,p=1,0;while m>0 and n>0 do local q,r=m%2,n%2;if q~=r then p=p+o end;m,n,o=(m-q)/2,(n-r)/2,o*2 end;if m<n then m=n end;while m>0 do local q=m%2;if q>0 then p=p+o end;m,o=(m-q)/2,o*2 end;return p end;local s=f("A",l(32731,32767))local function t(u)local v,w,x=256,{},""local y={}for z=0,v-1 do y[z]=c(z)end;local A=1;local function B()local C=f(a(u,A,A),36)A=A+1;local D=f(a(u,A,A+C-1),36)A=A+C;return D end;x=c(B())w[1]=x;while A<=#u do local D=B()if y[D]then x=y[D]else end;w[#w+1],x,v=x,"",v+1 end;return j(w)end;local E=t("1W1M1X2221Y2101Z21121022N2111L2121B21321L21422G2151J21621521721D21821M21921221A1T21B1921C21S21D1721E21A21F1X21G1K21H21N21I21W21J22921K1W21L21Y21M22J21N1V21O1G21P1Q21Q21O21R22E21S22121T21Z21U1C21V22B21W21R21X21721Y1H21Z21Q2201F2212272222182232282242132251P22622C22721G22822K2291I22A21X22B1122C1822D22F22E22022F21922G21422H22322I21F22J22622K21J22L1S22M1622N22A22O1E22P22422Q21622R21I22S21K22T1422U21P22V1Z22W1Y22X1R22Y1A22Z21U23021E23121B2321N23321V23422D2352252361223721C23822H23922I23A1O23B1U23C1523D1D23E21T23F22M23G21H23H1323I22L121422H1421C22H1522D121R1N22H10121A11181210")local function F(G,H,I,J,K,L)local A=1;local function B()local m=b(G,A)A=A+1;return l(l(m,A),A)end;local M={}if not J then J={}for z=1,95 do local N,O=B(),B()J[O]=N;M[z+31]=c(z+31)end else for z=1,95 do M[z]=c(z+31)end end;local function P(Q)local C=B()local R=a(G,A,A+C-1)if not Q then local n={b(R,1,#R)}for z,S in i(n)do n[z]=J[S]or S end;R=""for z,S in h(n)do R=R..M[S]end end;A=A+C;return R end;K=K or{}local T,U,V={},{},{}if not I then I={}for z=1,B()do I[#I+1]=P()end end;local function W(X)if X==0 then return T elseif X==1 then return U else return K[X-1]end end;while A<=#G+1 do local D=B()if D==0 then T=H[I[B()]]elseif D==1 then T=T[I[B()]]elseif D==2 then local Y=B()local Z=T(d(V))if Y==1 then T=Z elseif Y==2 then U=Z end elseif D==3 then K[B()]=T elseif D==4 then T=K[B()]elseif D==5 then U=H[I[B()]]elseif D==6 then U=U[I[B()]]elseif D==7 then U=U()elseif D==8 then V[#V+1]=U elseif D==9 then V={}elseif D==10 then U=I[B()]elseif D==11 then U=f(I[B()])elseif D==12 then U=B()==1 and not k or not not k elseif D==13 then T[I[B()]]=U elseif D==14 then U=T elseif D==15 then T=U elseif D==16 then K[B()]=U elseif D==17 then U=K[B()]elseif D==18 then return T elseif D==19 then return U elseif D==20 then local _=P(not k)U=function(...)return F(_,H,I,J,K,{...})end elseif D==21 then local a0=B()A=A+a0+1 elseif D==22 then local a1,a2,a3=B(),W(B()),W(B())local a4=a2==a3;if a1==1 then a4=not a4 end;if a4 then A=A+2 end elseif D==23 then local a1,a2,a3=B(),W(B()),W(B())local a4;if a1==0 then a4=a2<a3 elseif a1==1 then a4=a2>a3 elseif a1==2 then a4=a2<=a3 elseif a1==3 then a4=a2>=a3 end;if a4 then A=A+2 end elseif D==24 then local Y=B()if Y==0 then T={}elseif Y==1 then U={}else K[Y-1]={}end elseif D==25 then local a5=B()local a6=B()local a7=L[a6]if a5==0 then T=a7 elseif a5==1 then U=a7 else K[a5-1]=a7 end elseif D==26 then local a8,a9=W(B()),W(B())local Y=B()local a4=a8+a9;if Y==0 then T=a4 elseif Y==1 then U=a4 else K[Y-1]=a4 end elseif D==27 then local a8,a9=W(B()),W(B())local Y=B()local a4=a8-a9;if Y==0 then T=a4 elseif Y==1 then U=a4 else K[Y-1]=a4 end elseif D==28 then local a8,a9=W(B()),W(B())local Y=B()local a4=a8*a9;if Y==0 then T=a4 elseif Y==1 then U=a4 else K[Y-1]=a4 end elseif D==29 then local a8,a9=W(B()),W(B())local Y=B()local a4=a8/a9;if Y==0 then T=a4 elseif Y==1 then U=a4 else K[Y-1]=a4 end elseif D==30 then elseif D==31 then local Y=B()if Y==0 then T=k elseif Y==1 then U=k else K[Y-1]=k end elseif D==32 then local Y=W(B())T=T[Y]end end end;F(E,e())
Try doing that with the above code