check cap tfs 1x

theduck

Member
Joined
Dec 6, 2018
Messages
89
Reaction score
13
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
 

Perun

GET SHIT DONE
Premium User
Joined
May 1, 2009
Messages
256
Reaction score
78
Where is return? and show full script.
 
OP
T

theduck

Member
Joined
Dec 6, 2018
Messages
89
Reaction score
13
No it's not 🙂
it's just this function that I'm having problems as other functions are okay .. they are separated there is no way this has no reason for everything loot auto loot.
 

Stigma

Veteran OT User
Joined
Feb 14, 2015
Messages
4,587
Reaction score
2,147
it's just this function that I'm having problems as other functions are okay .. they are separated there is no way this has no reason for everything loot auto loot.
Who are you to decide what's important to give for others to help you if you have no idea what you're doing?
That's the kind of thing people will refuse to help you for.
 
OP
T

theduck

Member
Joined
Dec 6, 2018
Messages
89
Reaction score
13
Who are you to decide what's important to give for others to help you if you have no idea what you're doing?
That's the kind of thing people will refuse to help you for.
why should I post everything? Is the problem only in one function?
if you do not want help just do not help.
 

WibbenZ

Global Moderator
Staff member
Global Moderator
Joined
Oct 16, 2008
Messages
6,190
Reaction score
1,128
Location
Sweden
Top