Forum > General >

[How-To] How to add special functions (if you use an C# API)

Posts: 369

Threads: 61

Joined: Apr, 2018

Reputation: 0

Posted

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.)
  • 0

Added

Revision 1: The code displayed in method #1 is in C# (C Sharp), and the code it injects to ROBLOX is in Lua, but all put onto one line. Other thing, I made a typo in "hellowWorld", which should've be "helloWorld".
  • 0

Added

Revision 2: Don't forget to tell your exploit users the function's definition and usage!
  • 0

Users viewing this thread:

( Members: 0, Guests: 1, Total: 1 )