Setting Up
🛠️ Setting Up Your First Script
1. Create a Lua File
Create a new text file and save it with a .lua
extension (e.g., my-first-script.lua
).
2. Place it in the Scripts Folder
Find the Serotonin data folder on your computer and place your new .lua
file inside the scripts
subdirectory. You can use the "Open Scripts Folder" button in the menu's Scripting tab to get there quickly.
3. Write Your Code
Open the file in a text editor (like VS Code, Notepad++, or Sublime Text) and write your script. A simple "Hello, World!" script looks like this:
print("Hello from my first script!")
-- Draw a green square on the screen
local function draw_square()
draw.rect(500, 500, 50, 50, 0, 255, 0, 255)
end
-- Register our drawing function to the onPaint event
cheat.register("onPaint", draw_square)
4. Load the Script
In the Serotonin menu, navigate to the Scripting tab. Your new script should appear in the list.
Click on your script's name in the listbox.
Click the "Load" button.
You should now see the message in the console and a green square on your screen!
Last updated