Undertale Yellow script viewer

← back to main script listing

gml_GlobalScript_scr_actor_into_follower

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

function scr_actor_into_follower(arg0, arg1) { if (!instance_exists(arg0)) return false; if (arg1 == -4) return false; instance_create(arg0.x, arg0.y, arg1); arg1.x = arg0.x; arg1.y = arg0.y; with (arg0) { switch (npc_direction) { case "up": arg1.sprite_index = arg1.up_sprite_idle; break; case "down": arg1.sprite_index = arg1.down_sprite_idle; break; case "left": arg1.sprite_index = arg1.left_sprite_idle; break; case "right": arg1.sprite_index = arg1.right_sprite_idle; break; } } instance_destroy(arg0); }
(arg0, arg1)
2
{
3
    if (!instance_exists(arg0))
4
        return false;
5
    if (arg1 == -4)
6
        return false;
7
    instance_create(arg0.x, arg0.y, arg1);
8
    arg1.x = arg0.x;
9
    arg1.y = arg0.y;
10
    with (arg0)
11
    {
12
        switch (npc_direction)
13
        {
14
            case "up":
15
                arg1.sprite_index = arg1.up_sprite_idle;
16
                break;
17
            case "down":
18
                arg1.sprite_index = arg1.down_sprite_idle;
19
                break;
20
            case "left":
21
                arg1.sprite_index = arg1.left_sprite_idle;
22
                break;
23
            case "right":
24
                arg1.sprite_index = arg1.right_sprite_idle;
25
                break;
26
        }
27
    }
28
    instance_destroy(arg0);
29
}