Ok yeah it's only with the rex not with the ptero. On the event for the rex you subtract from hp but you don't with the ptero. Subtracting 50 hp means it runs the player 1 death twice and spawns 2 rex objects, it runs the function when player hp equals 0 and also on collision with the lava.