-
Notifications
You must be signed in to change notification settings - Fork 1
Level
KabanFriends edited this page Aug 3, 2023
·
4 revisions
A Level
is an object that holds the level that the script is running on. It can be accessed from the constant variable level
.
- Name of the level.
- Number of players currently in the level.
- The number of milliseconds that have passed since the unix epoch time (January 1, 1970).
- Sends a message to all players in the level.
- Returns the list of Players currently in the level.
getPlayer(string: name)
: Player
- Returns a Player object by their player name. It will return
nil
when the player with the specified name is not in the level.
- Gets the name of a block by its numerical ID. (e.g. 1 -> "Stone", 2 -> "Grass Block")
- Gets the numerical ID of a block by its name.
- Places a block at the specified coordinate in the level.
- The
block
parameter can be either a number of the block ID, or a string of the block name.
- Gets the numerical ID of a block at the specified coordinate in the level.
This section is the documentation of data storage related functions. See Data Storage for more information about data storages.
- Writes a data with the specified key to the level's data storage.
- Reads a data with the specified key from the level's data storage.
- Returns
nil
if the specified key doesn't exist.
- Removes a data with the specified key from the level's data storage.
- Returns true if a data with the specified key exists in the level's data storage.
- Returns a table with all keys and their data in the level's data storage.
- Clears all data from the level's data storage.