Hi Who said that I
Some common terms to remember in programming is declaration and definition.
Declaring is when a variable is 'declared' as a type
Defining is when that variable is given a definition: Eg, this variable is specifically this monster
In programming, the declaration and definition can be separate lines, or as Failed.Bard pointed out, you can have them on the same line at the same time.
But you must always declare a type associated with the variable, otherwise when you try to use oTarget, the compiler does not know what type of object it is.
In most modern programming languages, they may be able to infer the type, from the method you are calling.
But NWScript is just a scripting language, and it is very old.
So you could have got your script working by doing one of the following:
#include "nw_i0_plotwizard"
#include "NW_I0_GENERIC"
#include "pqj_inc"
void main()
{
// Set the variables
SetLocalInt(GetPCSpeaker(), "p021state", 300);
// Get the PC who is in this conversation.
object oPC = GetPCSpeaker();
// Update the player's journal.
AddPersistentJournalQuestEntry("p021", 3, oPC, FALSE);
// Spawn "creature007".
object oTarget;
oTarget = GetWaypointByTag("WP_SUBSTITTUTE_001");
or
object oTarget = GetWaypointByTag("WP_SUBSTITUTE_001");
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "creature007", GetLocation(oTarget));
AssignCommand(oSpawn, ActionStartConversation(oPC));
}