Set a variable to check if the player can attack (for example 0 is able to attack and 1 isn't), set an alarm and disable the attacks, in the alarm event set the variable again to 0.
Something like this:
create event
can_attack = 0
step
if keyboard_check(vk_space) and can_attack = 0
{
//attack
can_attack = 1
alarm[0] = 5*room_speed
}
alarm event
can_attack = 0