How could I make a new script with my own custom code in it with a script in game?

I tried using source, but it just throws an error.

You can’t do that, closest thing you can do is run a console string or insert pre made scripts with InsertService.

Aw. Well, insertservice will work.

Source is a ProtectedString type, it can’t be changed ingame, only through plugins and console, so you have a few ways of going about it:

  • Make a new script and set the source of it from the console
  • Make a plugin that does this for you
  • Put the script somewhere and clone it
  • Or Insert premade scripts, not sure about this one if it’ll work, but I think it should
1 Like

If you want to execute the script on the server-side, you can use a remote event and loadstring

If you want to use it on the client-side, you can use a bytecode interpreter. You can often find them by searching for “loadstring module” on the library

This one works well.