Skip to content

Calling engine functions

Service and library functions take a dot, and Entity methods take a colon. Services are globals such as World, Players, and Net; libraries are globals such as task and Geometry.

-- Server script in a part.
local door = World.Spawn({})
door.Name = "Door"
door.Parent = World

print(World.Find("Door") == door) -- prints true

task.delay(1, function()
    door:Destroy()
    print(door:IsAlive()) -- prints false
end)

Calling a service or library function with a colon passes its table as the first argument and fails strict type checking. Where a function or property takes a string, a number converts to its decimal string.

Engine errors lists the errors every engine function shares.