Announcement

Collapse
No announcement yet.

Base script

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    GAMEMODE Base script

    Wanted to make a basic gamemode where people can get the hang of how to code something a gamemode on Onset, while its not yet.

    https://github.com/kaperstone/blank-onset-server


    It doesn't demonstrate complicated situations or full capabilities of the language, it mostly shows off how to interact with the database and process commands.
    It has basic commands to spawn vehicle, some admin stuff, change model, resize your head and kill yourself.

    I have no idea if it even compiles, so good luck.

    #2
    Nice! After the next video we are going to release more example scripts.

    Some important errors:
    - You actually have to initialize the PlayerData table for the specific player id before using it.
    - Under "packages" in the server config you have to specify the name of the package. A package is a folder in the "package" directory. It's a collection of Lua scripts and other files.

    Comment


      #3
      Originally posted by Talos View Post
      - You actually have to initialize the PlayerData table for the specific player id before using it.
      Yeah, I've done it at the bottom of the code after the player is authenticated in Steam? or did I misunderstand?
      Originally posted by Talos View Post
      - Under "packages" in the server config you have to specify the name of the package. A package is a folder in the "package" directory. It's a collection of Lua scripts and other files.
      Oh, and I was lost trying to find how to include the gamemode inside

      Comment


        #4
        You have to initialize a table for the player like this:
        PHP Code:
        PlayerData[player] = {} 
        And when you are done do:
        PHP Code:
        PlayerData[player] = nil 

        Comment

        Working...
        X