Skip to content

Dealing with Lua Online Scripts

CheesyManiac edited this page Jul 9, 2024 · 2 revisions

Important

Contrary to the name, Online Scripts DO NOT run on the server. They are still run on the client like any other script, which means they DO NOT sync between clients automatically - that is up to you to do within your script.

It is important to know that scripts cannot be hidden. CSP will print the direct link in the CSP log file, and any local Lua app can request and receive all the additional server options. Obfuscation is pointless as CSP does not support script encryption with private keys. Please do not message me about this, because I will not help you.

Useful links:

Usage

You're going to need to host your script in plaintext somewhere public. This can be:

  • Pastebin direct link
  • Github RAW link
  • Your own media server (like IIS or others)
  • DO NOT HOST ON DISCORD

In your encoded server Welcome Message or csp_extra_options.ini if you use AssettoServer place the following:

[SCRIPT_...]
SCRIPT = "https://pastebin.com/raw/00000000000"    ; Change this to the public URL of your script

If you need additional scripts, add additional headers in the INI file like so:

[SCRIPT_...]
SCRIPT = "https://pastebin.com/raw/00000000000"

[SCRIPT_...]
SCRIPT = "https://pastebin.com/raw/00000000000"

Thanks to INIpp, the ... will be automatically changed to a number value.

Local debugging

Yes, you can load a server script without hosting it and gain access to live-reload

DO NOT USE THIS FOR REAL USE, as it will mean players can edit the local script and access functions they should NOT be able to.


  1. Put your script here: yoursteamlibrary\steamapps\common\assettocorsa\extension\lua\online\ (create the folder if it is not there)

    and name it whatever you want, I'll go for example.lua

  2. Then in your encoded server Welcome Message or csp_extra_options.ini if you use AssettoServer, put ONLY the file name of the script you want to run locally

[SCRIPT_...]
SCRIPT = "example.lua"
  1. Open that file in your favourite editor. Probably VSC if you followed these instructions
  2. And that is it! Each time you save the file, CSP will reload the script. Once you are ready, upload that script somewhere public (NOT DISCORD)