Undertale script viewer

← back to main script listing

gml_Script_scr_itemget

(view raw script w/o annotations or w/e)
1
i = 0;
2
loop = 1;
3
noroom = 0;
4
global.item[8] = 999;
5
while (loop == 1)
6
{
7
    if (global.item[i] == 0)
8
    {
9
        global.item[i] = argument0;
10
        break;
11
    }
12
    if (i == 8)
13
    {
14
        script_execute(scr_itemnospace);
15
        break;
16
    }
17
    i += 1;
18
}
19
ossafe_ini_open("undertale.ini");
20
var bc = ini_read_real("General", "BC", 0);
21
if (bc < 4)
22
{
23
    bc++;
24
    ini_write_real("General", "BC", bc);
25
    ossafe_ini_close();
26
    ossafe_savedata_save();
27
}
28
else
29
{
30
    ossafe_ini_close();
31
}
32
if (bc >= 1)
33
    trophy_unlock("item_1");
34
if (bc >= 2)
35
    trophy_unlock("item_2");
36
if (bc >= 3)
37
    trophy_unlock("item_3");
38
if (bc >= 4)
39
    trophy_unlock("item_4");
40
script_execute(scr_itemnameb);
41
script_execute(scr_itemname);