Code:
local function checkPlayers(centerroom, rangeX, rangeY)
local spectators = Game.getSpectators(centerroom, false, false, rangeX, rangeX, rangeY, rangeY)
for _, spec in ipairs(spectators) do
if spec:isPlayer() then
return true
end
end
return false
end
if checkPlayers(config.centerroom, config.rangeX, config.rangeY) then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'There is someone in the room.')
return true
end
I would like to have a limit on the function up to 5 players in the room he lets in more than 5 he informs that the room is full[/code]
Last edited: