Probably just need to change OBJECT_SELF to oPC if the script is supposed to run on whoever acquired the item. But also like MrZork already said, you are using oPC in a function before you even define it. Unless you are doing it twice in your script for some reason.
Something else I don't understand though...if this is an OnAcquire script then why are you even using GetPCSpeaker? You should be using GetModuleItemAcquiredBy. And if this is a tag based script then you also need a check at the top of your script for the item event if you don't already have one. I guess I'm not really clear as to what is going on here.
You really should post the whole script.
I see you have a tag check for the item which means you are probably not using tag based scripting for this. Probably putting everything into an OnAcquire script? This is all just speculation of course.
Your script should/might look something like so:
void main()
{
//object oPC = GetPCSpeaker();
object oPC = GetModuleItemAcquiredBy();
//stuff
//other stuff
//if (//stuff)
//{
//stuff
//}
else if(GetTag(oItem)=="GoblinStandard")
{
object oTarget;
AddJournalQuestEntry("GoblinStandard", 2, oPC);
SetLocalInt(oPC, "nVictorLV", 1);
oTarget = GetObjectByTag("sCheers1lv");
SoundObjectPlay(oTarget);
oTarget = GetObjectByTag("sCheers2lv");
SoundObjectPlay(oTarget);
ExecuteScript("gob_retreat", oPC);
}
}
Modifié par GhostOfGod, 16 mai 2011 - 02:54 .