SetVirtualWorldOwnDoors
Gives a virtual world doors of its own - what its players open or lock there stays in it.
By default every virtual world (SetPlayerVirtualWorld) shares the doors of world 0: a door used in any world moves for
everyone. A world given its own doors starts from the level’s own state of each door (shut, the level’s own lock): a player’s use
there changes it for that world’s players alone, and SetDoorState / GetDoorState take the world. One interior copied into
many worlds - the flats behind one address - then has doors of its own in each copy. A player moved into or out of such a world sees
its doors at once. A world’s own doors are kept while the server runs (after a restart, set what your instances need again from
your own storage); false forgets them and the world shares world 0’s again. The mode’s rules on a door (SetDoorCheck,
SetDoorPrompt, SetDoorLockSides) hold in every world, and a door’s key can be one world’s (SetDoorKey); in
OnPlayerUseDoor the user’s world is GetPlayerVirtualWorld. The chests are still shared by every world.
Syntax
Section titled “Syntax”SetVirtualWorldOwnDoors(world [, own])| Parameter | Type | |
|---|---|---|
world |
number | the virtual world (not 0, whose doors are the shared ones) |
own |
boolean | true (the default) for doors of its own, false to share world 0’s again (optional) |
Returns
Section titled “Returns”boolean - false for world 0 with true
Example
Section titled “Example”-- a flat: its copy of the house keeps its own doors, locked until the tenant's key opens themSetVirtualWorldOwnDoors(flat.world, true)SetDoorState(FLAT_DOOR, false, true, flat.world)SetDoorKey(FLAT_DOOR, flat.keyId, flat.world)See also
Section titled “See also”HasVirtualWorldOwnDoors · SetDoorState · SetPlayerVirtualWorld · the Doors and containers group of the index
