Still have questions? Join our Discord server and get real time help.
0

# Inventory slot trying to find another when full?

Paldi 109
3 years ago

Anyone could help me figure this out? this is for when i pick up an item it goes in my inventory but now if my inventory is full (there is 12 slots) it will try looking for the 13th slot and create an error, how could i make it detect that "i" is higher than 12?

if invslot["Slot"..i] == "Slot13" then
etc
end


1
RubenKan 3590
3 years ago

simpfuly do

if i > 12 then
break
end


This will check if i is greater then 12, if so, it will end the current loop. (Thus, break).

0
thanks! sometimes i feel like i don't even think -.- xD Paldi 109 — 3y