Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_newhome_special_bench_Step_0

(view raw script w/o annotations or w/e)
1
event_inherited()
2
if interact
3
    waiter = 1
4
if waiter
5
{
6
    if (npc_flag == 0)
7
    {
8
        scr_text
scr_text

function scr_text() //gml_Script_scr_text { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue) }
()
9
        with (msg)
10
        {
11
            sndfnt_array[0] = 391
12
            ch_msg = 1
13
            ch[1] = "Yes"
14
            ch[2] = "No"
15
            message[0] = "* (You spot a discarded bag of#  Popato Chisps under the#  bench.)	"
16
            message[1] = "* (Take it?)"
17
            if (outcome == 1)
18
            {
19
                if scr_item
scr_item

function scr_item(argument0) //gml_Script_scr_item { nm = argument0 var i = 1 while (i <= 8) { if (global.item_slot[i] == "Nothing") { global.item_slot[i] = nm return true; } else { if (i == 8) return false; i++ continue } } }
("Popato Chisps")
20
                {
21
                    message[2] = "* (You got Popato Chisps!)"
22
                    other.npc_flag = 1
23
                    other.waiter = 0
24
                }
25
                else
26
                {
27
                    message[2] = "* (Not enough space.)"
28
                    other.waiter = 0
29
                }
30
            }
31
            else if (outcome == 2)
32
                other.waiter = 0
33
        }
34
    }
35
    else
36
    {
37
        scr_text
scr_text

function scr_text() //gml_Script_scr_text { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue) }
()
38
        with (msg)
39
            message[0] = "* (A sturdy park bench.)"
40
        waiter = 0
41
    }
42
}