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.