You may want to give them some items, but do you only want to give them the items once. I would assume so. One way would be to just add a 2 lines for ever item, and then seiing if they have it or not to your onclient enter module script:
object oObjectToGive = GetItemPossessedBy(oPC, "TagOfObjectToGive");
if (!GetIsObjectValid(oObjectToGive))
{
// Now create the object on the PC if they don't have one
CreateItemOnObject("resrefofobjecttogive", oPC, 1);
}
So you would have to follow that method for every item you want to give them.
An alternative method would be to give the items you want to any PC who had less than 1 experience pt. and then have the script return, otherwise. Then after the items have been given to the PC also give them 1xp pt before the script exits.
Something like this:
//::///////////////////////////////////////////////
//:: FileName: onenterexample
//:://////////////////////////////////////////////
//:://////////////////////////////////////////////
//:: Created By: Script Wizard
//:: Created On: 2/9/2008 9:48:30 PM
//:://////////////////////////////////////////////
void main()
{
object oPC = GetEnteringObject();
if (GetXP(oPC)<1)
{
// Give the speaker the items
CreateItemOnObject("resrefofitem", oPC, 1);
CreateItemOnObject("resrefofitem", oPC, 1);
CreateItemOnObject("resrefofitem", oPC, 1);
CreateItemOnObject("resrefofitem", oPC, 1);
CreateItemOnObject("resrefofitem", oPC, 1);
CreateItemOnObject("resrefofitem", oPC, 1);
CreateItemOnObject("resrefofitem", oPC, 1);
// Give the PC 1 XP
GiveXPToCreature(oPC, 1);
}
}
Modifié par ffbj, 25 janvier 2011 - 01:25 .