M
MagnusFT05
Guest
So i have like a sniper that i want to shoot at a certain place (so the player has to jump over the shots) And i saw a thread about this which said i needed to add this code to the "create" section of the guy whos shooting the bullet:
firingdelay = room_speed/6;
alarm(0) = room_speed * 5; //shoot every 5 seconds
and to write this in alarm 0:
instance_create_layer(x, y, "Bullets", ObjectBullet);
with (ObjectBullet)
{
direction = point_direction(x, y, ObjectPlayer.x, ObjectPlayer.y); // Give the bullet a direction
speed = 8;
}
alarm[0] = room_speed * 4;
and when i try to run the game the only error is: Object:SniperMan event: Create at line 9 : unknown function or script alarm
indicating that the alarm(0) line in the create event is wrong
How tf can i fix this?
firingdelay = room_speed/6;
alarm(0) = room_speed * 5; //shoot every 5 seconds
and to write this in alarm 0:
instance_create_layer(x, y, "Bullets", ObjectBullet);
with (ObjectBullet)
{
direction = point_direction(x, y, ObjectPlayer.x, ObjectPlayer.y); // Give the bullet a direction
speed = 8;
}
alarm[0] = room_speed * 4;
and when i try to run the game the only error is: Object:SniperMan event: Create at line 9 : unknown function or script alarm
indicating that the alarm(0) line in the create event is wrong
How tf can i fix this?