loadstring(game:HttpGetAsync('https://raw.githubusercontent.com/strsplspace/utils/main/cenv.lua'))();<table>getprotoclosures(<LocalScript>);Returns the protos of LocalScript
<function>searchclosureconst(<any>Constants);Returns the function that contains Constants
Example of usage
LocalScript contains this code:
spawn(function()
spawn(function() --We need to get this functionprint('a');
warn('b');
end);
end);Our code:
localFn=searchclosureconst('print','a','warn','b');
print(Fn);This function now generates code after use, then the code gets copied into clipboard
--Code generated by cenvlocalFunction;
localConsts= {
["1"] ="print",
["2"] ="a",
["3"] ="warn",
["4"] ="b"
};
fori,vinnext,getgc(true) doif (type(v) =='function' andislclosure(v) andnotis_synapse_function(v)) thenfori2,v2innext,Constsdoiftable.find(debug.getconstants(v),v2) thenFunction=v;
end;
end;
end;
end;<function>searchclosureups(<any>Upvalues);Works same as searchclosureconst but with Upvalues
<table>gcsenv(<LocalScript>);Works same as regular getsenv but uses gc instead, it can be useful if function in a table, regular getsenv doesn't going to return that function
<table>getscriptlocals(<LocalScript>,<Optional>Iterations);Returns the NON Upvalue variables of script, by default Iterations = 400
<boolean>cenv.Test(<void>);The compatability function
cenv.GetFunctions(<void>);Prints all functions in Synapse console, that are supported
<string>cenv.Find(<string>Functionname);Returns the name of function if finds it
cenv.Copy=<boolean>Responsible for copying in SG.Generate,by default its true
This project can contain bugs, if you found one make a pull request.