• 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!

check cap

theduck

Member
Joined
Dec 6, 2018
Messages
246
Reaction score
20
Code:
 -----
                                  if  player:getStorageValue(9398329) == 1  and player:getCapacity() > 100 then
                                  containerItem:moveTo(player)
                                  
								  elseif player:getCapacity() > 100  then 
                                  containerItem:moveTo(bag)
								  
								  elseif player:getCapacity() < 100  then
                                  
                                   player:sendCancelMessage("It is too heavy or you have not enough space.")
								  
								  
                                end
							---

I'm trying to put a check cap on my self loot more without much success
 
Code:
    if TESTEAutoLootList.players[playerId] ~= nil then
         local lootList = TESTEAutoLootList.players[playerId].lootList
         if lootList ~= nil then
            if corpse:getType():isCorpse() then
                for a = corpse:getSize() - 1, 0, -1 do
                    local containerItem = corpse:getItem(a)
                    if containerItem then
                        local containerItemId = containerItem:getId()
                        for i=1, #lootList do
                            local lootItemId = lootList[i]
                            if lootItemId == containerItemId then
							 
				  if   player:getFreeCapacity() > 100 and player:getStorageValue(9398329) == 0    then 
                                   containerItem:moveTo(bag)
								   
                                   elseif player:getFreeCapacity() > 100 and player:getStorageValue(9398329) == 1     then
                                    containerItem:moveTo(player)
								 
								   else  							
                                  player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, string.format(" It is too heavy or you have not enough space."))
								  
                                end
                            end
                        end
                    end
                end
            end
        end  
	 end     
 end

I still have not had success even putting it to jump to the next option if the cap is less than 100 it ignores the check cap
 
Back
Top