Okay, Loadlibrary

And i dont just want code to prevent this, i want to learn how it works so i can make a full proof anti-bypass system.

(basically im doing this so people with this command cant give themselves “require scripts” and other stuff.)

If I’m understanding this correctly, why not just create a wrapper? That sounds like the next best thing.

A what?? I forgot how to do a wrapper. Can you refer me something to help me?

Is it just coroutine.create(coroutine.wrap())

If so we’re talking about a known sandbox bypass that i wanna patch.

I just dont know how to do it. (the sandbox bypass)

Should i use rongo’s api wrapper??

A wrapper is basically a type of environment to make different things compatible within the same space. In this sense, it would allow you to create a custom environment for code execution. In this sense, it would translate text into code and execute it.

Also in regards to this, you can just use task.spawn().

The thing im trying to figure out is something quite like this. SInce i found that this used to work and i feel people found a way to make this work again:

if game.PlaceId == 178350907 then
	  script.Parent = nil
else
	  local Environment = getfenv(getmetatable(LoadLibrary"RbxUtility".Create).__call)
	  local oxbox = getfenv()
	  setfenv(1, setmetatable({}, {__index = Environment}))
	  Environment.coroutine.yield()
      oxbox.script:Destroy()
end

Apparently this used to work.

Found this on scriptinghelpers How does this code bypass Voiliax / Oxcool1's Script Builder sandbox? - Scripting Helpers

I’m not really familiar with that sort of thing, so I can’t really say. But writing your own wrapper would allow you to customize exactly what features exist and which don’t. But it’ll take some effort if you’re starting from scratch.

Well then ill have to give up since i have little to no knowledge on how that piece of code works either. as since its now broken with the removal of loadlibrary andd the deprecation of getfenv and setfenv

I’m not sure if what you’re looking for is here, but Roblox released this module when they depreciated the LoadLibrary:

LoadLibrary.rbxmx (249.0 KB)

What im trying to uncover is rbxutility.create, but i cant find it.

Create, from what I’ve seen, is really only used to Instance a new object with specific properties, all at once.

From what I heard you want to achieve, you can use an actor to run code in parallel

task.desynchronize() -- runs code in seperate thread
-- Note you must put the script inside the actor to do this

Their goal appears to be creating a script environment for the purpose of an in-game script executor. Parallel Lua (multi-threading) is a very different topic.

Im just trying to figure out what create returns.