Skip to Content

Introduction

Platform overview: worlds, Studio, the Lua runtime and the server/client execution model.

Cube3D Studio with a world and the Explorer open

Game structure

A Cube3D game is a world: parts, models, scripts, tools, teams and settings stored as one document. Worlds are edited in Studio, tested with Play and released with Publish. Servers always load the most recently published version.

ObjectDescription
PartsPhysical primitives with shape, color, material and physics properties.
ModelsContainers that group parts, models, values and scripts.
ValuesTyped single-value objects used for configuration.
StorageInactive container for objects that scripts clone into the world.
ScriptsLua code executed on the server or on each client.
ToolsEquippable items with activation events.

Execution model

Scripts run in one of two contexts:

  • Server scripts run once per server and are authoritative for game state: scoring, damage, round flow and persistence.
  • Client scripts run on each connected device and handle local presentation: UI, input and screen effects.

The two contexts communicate through Remote events and replicated State. See Scripts.

Runtime

Scripts run on Lua 5.4 with the Cube3D API exposed through game:GetService. The standard library is restricted to the functions listed in Globals.

local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(player)
	player:SendMessage("Welcome, " .. player.Name .. "!")
end)

Next steps

On this page