Can I run code using HttpService:GetAsync()

And why should I use game:GetService()?

Instances (including services, they are technically instances too) can be renamed to whatever someone would like. This would cause your code to break in that case.

Oooh, that makes much more sense, thank you.

Just a heads up for anyone using H3x/planning to (also make sure you set up the sandbox to your needs, otherwise its not any better than plain loadstring): If your code uses a lot of yielding or built in functions which yield it may function differently than you’d expect when used in the sandbox.

That’s due to how I sandbox functions and it unfortunately means that in the case of calling certain sandboxed functions their yields can appear to be ignored. I’m not sure what consequences this has on a large scale, but for general code execution it’s not particularly an issue.

Lastly, as other’s were saying, loadstring is safe as long as you’re not using any user input in loadstring. With proper protection you can make it work, but generally if you’re taking code from an outside source (e.g. a website or player) I wouldn’t recommend just running the code unless you trust that the platform you’re using is secure.

1 Like