In most the of APIs, there are missing functions like loadstring, getHttp, etc. And you may want to add custom functions (i.e. godMode(string playerName)), so to do these, there are two ways:
Appending a Lua script at the start of user's script
This might be the easiest way, but will only let you use the functionalities that are extra inside the Roblox Player. To begin, let's suppose that you have a "exec" function that serves as a Lua execution function. It will need a parameter, the script, of type String. Now let's add our custom functions!
public void customExec(string script){
string str = script;
string extraStr = "function hellowWorld () print(\"Hello World!\")"; // For example, we add a "helloWorld" function that prints "Hello World!"
str = extraStr + str;
exec(str);
}
Replace specific text with other string
Following the previous method, you can also replace "HelloWorld" by the content of it (What it executes.)
Cancel
Post