Skip to content

PlaceMapPrefab

Places a prefab’s objects as new map objects.

PlaceMapPrefab(name, x, y, z [, opts])
Parameter Type
name string the prefab
x number metres - where its pivot goes
y number metres
z number metres; below 0 = on the ground
opts table yaw (degrees, turns the whole prefab about its pivot), layer ("base"), persist (true) (optional)

table - the new objects’ ids in the prefab’s order; nil and the reason

-- a row of stalls
for i = 0, 3 do PlaceMapPrefab("stall", 1280 + i * 4, 1100, -1, {yaw = 180, persist = false}) end

SaveMapPrefab · GetMapPrefabs · CreateMapPrefab · the The server’s map group of the index