• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

bonus for mc

theduck

Member
Joined
Dec 6, 2018
Messages
246
Reaction score
20
Code:
function onLogin(player)
    local maxMC = 10

    local mcAmount = 0
    for _, tmpPlayer in ipairs(Game.getPlayers()) do
        if (player:getIp() == tmpPlayer:getIp()) then
            if mcAmount >= maxMC then
                return false
            end

            mcAmount = mcAmount + 1
        end
    end
     return true
end


I'm trying to adapt this code so that when the player logs it to gain more storage if he already has 4 character logged in he does not win this storage
 
How you wanna define which of them is the one that should gain storage? You could go by last online is older than other mc's but even then it wouldn't work flawless.
 
this is the problem I thought of using anti mc as an example
Anti MC is catching user by his IP, you can't define the "main"-character by his IP. That wont work. He will have to set this manually somewhere. Maybe by an command or something. Anything that makes his "main"-character to the character which should gain the storage.
 
Back
Top