4.0l OHV is a good engine.
Use motorcraft spark plugs, lots of mis-fires with other brands
1999 was the first year of the PATS system(passive anti-theft), adding new keys can be expensive so make sure you get 2 PATS keys with it and then you can add a third yourself so you will always have 2 if one is lost.
1999 Ranger will have Type B PATS
If you want to add a key....
**You must have two original keys to perform this procedure. If you only have one key, you WILL have to take it to the dealer to get it programmed**
1. Insert an existing (working) key into the ignition cylinder.
2. Turn the ignition cylinder ON (RUN) and back to OFF. Ignition should stay on for at least ONE SECOND.
3. Remove the existing key and, within TEN seconds, insert a second working key and turn it to ON (RUN) and the back OFF. Ignition must be in ON for at least ONE second, but no more than TEN seconds. Remove the key.
4. Insert the new key before TWENTY seconds have elapsed and turn it to ON (RUN). Leave it in the ON position for at least ONE second and turn back to OFF.
5. The security light will light up for THREE seconds to indicate that the new key has been successfully programmed.
6. To program additional keys, repeat steps 1 through 5
PATS keys have an RFID tag inside, this requires no batteries, the ignition cylinder has a "Loop" around it, when key is turned on the "loop" sends out a Radio signal(RF) this gives the PATS key's RFID tag enough power to broadcast(RF) it's unique ID code.
The "loop" picks this ID up and sends it to the PATS module(above glove box).
Module checks it's memory for that ID, if found the computer is allowed to start.
If not found then two things happen, the fuel is cut off for sure, so no start, but on some the starter motor will also not work, so no crank and no start.
The PATS module and computer are "married" when first programmed, so if either is replaced they need to be re-married to work, this requires a special programmer, so usually Ford Dealer only.
You can "clone" PATS keys vs adding a new key, this is less expensive if you only have one key and want a backup, but doesn't give you 2 keys to add new keys because as far as the PATS is concerned they are the same key because they have the same RFID number.
Locksmiths that sell PATS keys often have "writable" RFID keys, they can "read" the ID from original PATS key with a reader/writer RFID device, then "write" that ID to the new RFID key, then cut the key to work in door and ignition.
That is a "cloned" PATS key.