String to code?

Is it possible to convert a string into code that can be run in a script?

You can enable LoadStringEnabled on ServerScriptService, then you can use loadstring() on the server.

1 Like

As @batteryday said, you would enable LoadStringEnabled under ServerScriptService and use the loadstring() function to execute strings as code.

It should be noted that it is typically considered unsafe to use this, and LoadStringEnabled is set to false by default for safety purposes, as you could execute malicious code using loadstring. Be careful when using it.

2 Likes

Ah, darn. I was hoping there was a way that could work other than loadstring. Thanks.