prefabs.list
function#The names of the prefabs of the place.
prefabs.list() -> { string }
example
for _, name in prefabs.list() do print(name) endUse it forfilling a build menu or a random spawner with the name of every prefab in the place.
List prefabs and read their size
local prefabs = require("@usbx/prefabs")The names of the prefabs of the place.
for _, name in prefabs.list() do print(name) endUse it forfilling a build menu or a random spawner with the name of every prefab in the place.
What a prefab holds and its size. Nil if the place has no prefab with the name.
local car = prefabs.info("Car")Use it forchecking how big a vehicle prefab is before spawning it, so it fits in the garage.
nameName of a prefab of the place.Whether the place has a prefab with the name.
if prefabs.exists("Car") then print("the place has a Car") endUse it forchecking that a prefab is there before you spawn it, so a missing one does not cause an error.
nameName of a prefab of the place.