• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Windows Weapon Firing Delay

L

lolurban1

Guest
I'm trying to make an indie game, and I can't use firing delay, can you guys please help me:

x = oPlayer.x;
y = oPlayer.y+10;

image_angle = point_direction(x,y,mouse_x,mouse_y);

firingdelay = firingdelay - 1;
recoil = max(0,recoil - 1);

if (mouse_check_button(mb_left)) && (firingdelay < 0)
{
recoil = 4;
firingdelay = 5;
with (instance_create_layer(x,y,"Bullets",oBullet))
{
speed = 25;
direction = other.image_angle;
image_angle = direction;
}
}

----------------------------------
It gives me this error when I run it:

___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Step Event1
for object oGun:

Variable oGun.firingdelay(100011, -2147483648) not set before reading it.
at gml_Object_oGun_Step_1 (line 6) - firingdelay = firingdelay - 1;
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Object_oGun_Step_1 (line 6)
View attachment 23973 View attachment 23974 View attachment 23975
 
Last edited by a moderator:

FrostyCat

Redemption Seeker
Does that exclamation mark on the line that reads fringdelay instead of firingdelay hint you at anything?

You might want to spend more time reading your own code than posting screenshots of your code, which by the way is against the community posting guidelines.
 
L

lolurban1

Guest
Does that exclamation mark on the line that reads fringdelay instead of firingdelay hint you at anything?

You might want to spend more time reading your own code than posting screenshots of your code, which by the way is against the community posting guidelines.
Sorry I didn't read them since I was in a hurry

Does that exclamation mark on the line that reads fringdelay instead of firingdelay hint you at anything?

You might want to spend more time reading your own code than posting screenshots of your code, which by the way is against the community posting guidelines.
and thanks, I just realised, oof, thanks ly
 
Last edited by a moderator:
Top