This is what I have so far:
void main()
{
int nUser = GetUserDefinedEventNumber();
if (nUser = 1006)
{
int nMaxHP = GetMaxHitPoints();
int nCurrHP = GetCurrentHitPoints();
if((nCurrHP * 3) <= nMaxHP && GetLocalInt(OBJECT_SELF,"walker_do_once") == 0)
{
oTarget = oPC;
ITarget = GetLocation(oTarget);
oSpawn = CreateObject(OBJECT_TYPE_CREATURE,"testing",ITarget);
oTarget = oSpawn;
SetIsTemporaryEnemy(oPC, oTarget);
AssignCommand(oTarget, ActionAttack(oPC));
oTarget = oPC;
ITarget = GetLocation(oTarget);
oSpawn = CreateObject(OBJECT_TYPE_CREATURE,"testing",ITarget);
oTarget = oSpawn;
SetIsTemporaryEnemy(oPC, oTarget);
AssignCommand(oTarget, ActionAttack(oPC));
oTarget = oPC;
ITarget = GetLocation(oTarget);
oSpawn = CreateObject(OBJECT_TYPE_CREATURE,"testing",ITarget);
oTarget = oSpawn;
SetIsTemporaryEnemy(oPC, oTarget);
AssignCommand(oTarget, ActionAttack(oPC));
}
SetLocalInt(OBJECT_SELF,"walker_do_once",1);
}
}
The error is: VARIABLE DEFINED WITHOUT TYPE on line 11 (oTarget = oPC;)
Since I don't know how to write my own scripts and am trying to adapt premade scripts for my own use I'm not sure what to do and I'm guessing that besides something being wrong up there, it could also use some cleaning up. Any help would be greatly appreciated.
Modifié par DM Veil, 22 octobre 2011 - 03:17 .





Retour en haut







