Jump to content

Plans to Support Reserved Player Slots?


Recommended Posts

Maybe it could be done like this? Using the ids, like you would put them in adminlist.

TheNet = GLOBAL.TheNet local server_size = 6 local slots = {    id1 = "out",    id2 = "out"} AddPrefabPostInit("forest", function(inst)    inst:ListenForEvent("ms_playerjoined", function(inst, player)        local id = player.Network:GetUserID()        if slots[id] then            slots[id] = "in"        else            local size = server_size            for k, v in pairs(slots) do                if v == "out" then                    size = size - 1                end            end            if TheNet:GetPlayerCount() > size then                TheNet:Kick(id)            end        end    end)    inst:ListenForEvent("ms_playerleft", function(inst, player)        local id = player.Network:GetUserID()        if slots[id] then            slots[id] = "out"        end    end)end)

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...