Number of arguments expected - 4, Obtained - 3


Hallo Guys,

i am

completely new new too programming and i just startet with a flappy bird remake ;P

i use this video :

But i have a few problems,

One of this problem is in this codeline
alarm(0) =60
spread = 150;

var position
var spread
position = random(300) +spread

// Create the pipes in a random Lacation //

instance_create_layer(room_width, position -spread/2, NamekTreeUpside);

Video Minute 22;

It says : Number of arguments expected - 4, Obtained - 3 (Red Dot )

And if i try too programm the alarm i allways get: Unknown function or script alarm,

So i hope you could help me , i have so much fun but this errors burn my head XD

Tanks a lot ;)

Ps: Complete Coding Line

if (gravity = 0)

gravity = 2;
objCOntrol.alarm(0) = 20; here is alarm set !

if (dead = 0)


vspeed = -20;

image_speed = 0.5;



You can click the function with the middle mouse button to get the help page about it up that have an example as well:

instance_create_layer(x ,y ,layer_id, obj)
x = room_width
y = position -spread/2
layer_id = NamekTreeUpside
obj = ??

so you are only giving it 3 arguments, missing a 4th

the alarm need different brackets .. not ( ) ..but [ ] .. because it is an array


Hey Tailbit, thank you for your help,

Codlines are okay now, no misstake found.

But the sprites the game should create dont apear after starting the game, i dont know why...
Last edited: