Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

Inventory slot trying to find another when full?

Asked by
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 answer

Log in to vote
1
Answered by
RubenKan 3590 Moderation Voter Administrator Community Moderator
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
Ad

Answer this question