It is not against Roblox terms of service to execute code in-game using loadstring, but just think of the security issues possible by doing this. Code execution is a very powerful feature, both dangerous and beneficial. Unless you are 100% confident that no one else can access this feature, you can add it to your game.
This is perfectly fine, but I forgot to mention one more important detail. Client to Server communication is VERY important when using loadstring in your case. Make sure that the server knows that you are the one executing the code using the player object passed with Remote Events/Functions.
Considering that you can already use the command bar in the developer console, I would still advise against enabling loadstring, as it would make it much easier to create a huge security risk elsewhere without noticing. I don’t see any benefit if you are the only one that would have access.
Thats what I said, but from the looks of things, the script he put in the OP looks like it uses a custom loadstring implementation, which do work (I use one to reimpliment private modules), but I haven’t yet looked at the script, so I don’t know, just guessing.
Edit: Either way, this is overkill when you can just use the command line…
Actually, @grilme99 and @JoshRBX have a very good point to use the Developer Console, you could use your loadstring system or the console, however customisation is never a bad thing, it’s just that the fact that loadstring…
Its overkill and not needed when you can just use the command line. There is no need to customise anything because the command line works perfectly fine. If anything, this would hinder you because I’m 99% sure loadstring breaks for large scripts.
I am aware that it is not needed, but it is an option. The benefit of custom loadstring systems can also be expanded for allowing alt accounts to run code, as only the owner of the place can use the developer console to run code.
You can just give your alt account TC access to allow them to access the command line. You shouldn’t be giving your friends TC access or any sort of access to the command line because, if you have some falling out of something, they might abuse it. Using a custom loadstring just creates a security hole in your game if it isn’t properly secured. It is a waste of time making that when you can just use Roblox’s official method.
I agree that LoadString will cause security issues, which is why I have provided some information regarding security, however I just really want to push the idea of a custom loadstring system, you can easily add an alt account in-game with the use of DataStores, save frequently used code to avoid retyping or looking through your clipboard, customisation has always been a pro in game development, it just requires the right knowledge to handle the security issues.
Author’s Note:
I never really took the time to appreciate the possiblities of such feature, this is the first time I’ve ever talked about such feature.
I still think its quite excessive. I mean, why would you need to execute code in game anyway? And for the rare times you do need to, the console should work just fine. If your game is already finished and you have nothing better to work on, then sure, go for it, but I feel like there are much better things to work on.
When I posted this topic I forgot about the roblox dev console. But now that it has been mentioned above ^, haha I am laghing . I don’t really have a use case, I just asked if it would be against the rules.
Oh, guess not. Okay, that makes a custom implementation a better choice if thats what you need, but I still think you shouldn’t be executing code in a running game like that anyway.