Oh I forgot to include this line from your original script:
ExecuteScript("x2_plc_used_act", OBJECT_SELF);
So, it should look like this:
//goes on a lever or whatever device to save current location
void main()
{
object oPC = GetLastUsedBy();
if (!GetIsPC(oPC))
return;
ExecuteScript("x2_plc_used_act", OBJECT_SELF);
//the line above call the script which plays the animation of the lever or object calling it.
object oDatabase = GetItemPossessedBy(oPC, "database");
location lLocation = GetLocation(oPC);
// Store the location on the PC's database object
SetLocalLocation(oDatabase, "PC_LOCATION", lLocation);
SetLocalInt(oDatabase,"Location", 1);
//set location to 1 so the on enter will know you have a saved location.(could use True instead)
SendMessageToPC(oPC, "Location Updated!");
// Inform the player their location was saved. You may comment this out
// if you want.
}
Modifié par ffbj, 16 mars 2013 - 10:06 .