Skip to content

Getting Started

KabanFriends edited this page Nov 27, 2022 · 1 revision

To use Lua scripting in your OS map, you will need following things:

  • A text editor, preferably an editor that is designed for coding. (e.g. Notepad++, Visual Studio Code)
  • A file upload service that you can get the direct link to the file. (Direct links look like https://dl.dropbox.com/s/zcupt029b5b1ebk/dropbox-example.lua, Dropbox is very recommended as it keeps the same file URL even after reuploading the file)

After you have these stuff set up, you can start coding in Lua!
Here's an example code:

function onPlayerJoin(event)
    event.player.message("Welcome to my world!")
    if event.player.name == "KabanFriends" then
        event.player.message("&aYou are KabanFriends!")
    end
end

function onPlayerPressRightClick(event)
    event.player.message("Clicked!")
end

To upload your lua script to the server, first upload your .lua file to a file upload service. Grab the direct link to the file, and use /lua upload <URL> in your OS map.
Wait a few seconds until the file is uploaded to the server, and type /lua reload to load your script file.

Conguratulations, you now have a lua script running in your OS map!
From here, you can start coding whatever you want. If you need a list of things you can do, read the Documentation section of this wiki.