So you want the PC to be able to 'use' this item for it to tell them how many roleplay points they have? What I'd personally do is have a local integer which you add to whenever they gain points and give the item the unique power self only property. Then, when they use the item, a line spoken by the PC says how many points he/she has. You could get the PC to say it with something like this:
void main()
{
object oPC = GetItemActivator();
if (GetTag(GetItemActivated()) == "ITEM_TAG_HERE")
{
AssignCommand(oPC, SpeakString("You have " + IntToString(GetLocalInt(oPC, "RoleplayPoints")) + "roleplay points."));
}
}
You could then increase or decrease this integer with something like this:
void main()
{
object oPC= GetFirstPC(); // Or whichever function in appropiate for the script
SetLocalInt(oPC, "RoleplayPoints", GetLocalInt(oPC, "RoleplayPoints") +1); // Apply whichever maths you like
}
Modifié par C Writer, 31 août 2010 - 10:55 .