Undertale Yellow script viewer

← back to main script listing

gml_GlobalScript_scr_item_remove

(view raw script w/o annotations or w/e)
1
function scr_item_remove
scr_item_remove

function scr_item_remove(arg0) { for (i = 1; i <= 8; i += 1) { if (global.item_slot[i] == arg0) { while (i < 8) { global.item_slot[i] = global.item_slot[i + 1]; i += 1; } global.item_slot[8] = "Nothing"; return true; break; } else if (i == 8) { return false; } } }
(arg0)
2
{
3
    for (i = 1; i <= 8; i += 1)
4
    {
5
        if (global.item_slot[i] == arg0)
6
        {
7
            while (i < 8)
8
            {
9
                global.item_slot[i] = global.item_slot[i + 1];
10
                i += 1;
11
            }
12
            global.item_slot[8] = "Nothing";
13
            return true;
14
            break;
15
        }
16
        else if (i == 8)
17
        {
18
            return false;
19
        }
20
    }
21
}