Skip to content
This repository has been archived by the owner on Apr 17, 2024. It is now read-only.

Lobby Values

paige edited this page Sep 11, 2023 · 3 revisions

Lobbies have two main value things those being lobby values and starter player values


Lobby Values

Values for lobbies that are created when the lobby is created or by using new lobby.Value()

let lobby = new game.Lobby(ctx, {
    values: {
        score: 0
    }
});

console.log(lobby.score); // 0

new Lobby.Value()

description: creates a new lobby value
parameters:

  • name String: name of the value
  • content Any: content of the value
let lobby = new game.Lobby(ctx);

new lobby.Value("score", 0);

console.log(lobby.score); // 0



Starter Lobby Values

Values for lobbies that are created when the instance is created or by using new inst.StarterLobbyValue()
Starter lobby values are automatically applied onto every newly created lobby

let game = new Pangine("game", {
     starterLobbyValues: {
          score: 0
     }
});

let lobby = new game.Lobby(ctx);

console.log(lobby.score); // 0

new Inst.StarterLobbyValue()

description: creates a new starter lobby value
parameters:

  • name String: name of the value
  • content Any: content of the value
let game = new Pangine("game");

new game.StarterLobbyValue("score", 0);

let lobby = new game.Lobby(ctx);

console.log(lobby.score); // 0
Clone this wiki locally