Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_item_use_menu_Step_0

(view raw script w/o annotations or w/e)
1
var item_number = 8
2
var i = 1
3
while (i <= 8)
4
{
5
    if (global.item_slot[i] == "Nothing")
6
    {
7
        item_number = i - 1
8
        break
9
    }
10
    else
11
    {
12
        i++
13
        continue
14
    }
15
}
16
if global.down_keyp
17
{
18
    if (item_selected < item_number)
19
        item_selected += 1
20
    else
21
        item_selected = 1
22
    audio_play_sound(snd_mainmenu_select, 1, 0)
23
}
24
if global.up_keyp
25
{
26
    if (item_selected > 1)
27
        item_selected -= 1
28
    else if (item_number > 0)
29
        item_selected = item_number
30
    audio_play_sound(snd_mainmenu_select, 1, 0)
31
}
32
if keyboard_multicheck_pressed(0)
33
{
34
    global.item_used_overworld = global.item_slot[item_selected]
35
    audio_play_sound(snd_confirm, 1, 0)
36
    instance_destroy()
37
}
38
if keyboard_multicheck_pressed(1)
39
{
40
    audio_play_sound(snd_fail, 1, 0)
41
    scr_cutscene_end
scr_cutscene_end

function scr_cutscene_end() //gml_Script_scr_cutscene_end { global.cutscene = false obj_pl.alarm[0] = 1 }
()
42
    instance_destroy()
43
}