DataModel

Inherits ServiceProvider

DataModel represents the top-level container in the instance hierarchy. It inherits from ServiceProvider and manages all game services like Workspace. Typically accessed via the global `game` variable in Lua.

Examples

local workspace = game:GetService("Workspace")
local part = Instance.new("Part")
part.Parent = workspace

Methods

GetService(serviceName: string)

Instance Inherited from ServiceProvider

Gets a service by name, creating it if it doesn't exist

Parameters:

  • serviceName string
local workspace = game:GetService("Workspace")

FindService(serviceName: string)

Instance | nil Inherited from ServiceProvider

Finds a service by name without creating it

Parameters:

  • serviceName string
local workspace = game:FindService("Workspace")
if workspace then
print("Workspace exists")
end