Not tested.
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
local max = 20 -- max players per guild
local teleportto = {x = 32046, y = 31802, z = 7} -- waiting room
local guildid = getPlayerGuildId(cid) -- guild id func
if not isPlayer(cid) then...