Example: a school
This is the bundled scripts/school/main.luau script. It uses the maps/school.json map: a corridor, classrooms, a lecture hall, a great hall, a courtyard.
Each classroom has its own bucket#
local classes = map.zones({ type = "classroom" })
for _, classroom in classes do
classroom.onEnter = function(zone, player)
player:setBucket(zone.data.bucket, zone)
end
classroom.onExit = function(zone, player)
player:clearBucket(zone)
end
end
Classrooms are drawn in the map; the bucket number is in their data. The lecture hall is not here: the map gives it its bucket (150) directly, without a script.
Stairs teleport#
for _, stairs in map.zones({ type = "stairs" }) do
stairs.onEnter = function(zone, player)
player:teleport(zone.data.to)
end
end
A duelling circle, by script#
zones.poly({
name = "Cercle de duel",
points = { { -40, -10 }, { -30, -14 }, { -20, -10 }, { -18, 0 }, { -20, 10 }, { -30, 14 }, { -40, 10 } },
zmin = -1,
zmax = 5,
onEnter = function(_, player) player:set("duel", true) end,
onExit = function(_, player) player:set("duel", nil) end,
})
One house per player#
on("playerJoin", function(player)
local houses = { "Braiseval", "Verdombre", "Clairlune", "Boisclair" }
player:set("house", houses[player.id % 4 + 1])
end)
These are the French names of the houses: Embervale, Greenveil, Brightmoon and Brightgrove.