Skip to content

SetPlayerVirtualWorld

Moves the player into another virtual world.

From the next snapshot on the player sees, and is seen by, the players and entities of world only; the others part with them as if they had left and meet them again when they come back. Their mount comes along; a loose horse they controlled stays behind for whoever is nearest. Chat, the roster, the scoreboard, doors and containers stay global. Fights and hits stay inside a world. The client never learns its world - nothing changes on the player’s screen but who is around. Instanced duels, private lobbies, a hidden staging area for the next round.

SetPlayerVirtualWorld(pid, world)
Parameter Type
pid number the player
world number the world; 0 = the shared one

boolean - false when not connected

-- a private arena per duel: the two see nobody else
local function startDuel(a, b)
duelWorld = duelWorld + 1
SetPlayerVirtualWorld(a, duelWorld)
SetPlayerVirtualWorld(b, duelWorld)
end
local function endDuel(a, b)
SetPlayerVirtualWorld(a, 0)
SetPlayerVirtualWorld(b, 0)
end

GetPlayerVirtualWorld · SetEntityVirtualWorld · CreateHorse · the Players group of the index