This should do what you are looking for:
void main()
{
object oTarget = GetEnteringObject();
//Make sure target is a PC
if(!GetIsPC(oTarget)) return;
location lSpawn = GetLocation(GetWaypointByTag("clonewp"));
//Create clone
object oClone = CopyObject(oTarget, lSpawn, OBJECT_INVALID, "clone");
//Change to hostile and set AI level
ChangeToStandardFaction(oClone, STANDARD_FACTION_HOSTILE);
SetAILevel(oClone, AI_LEVEL_VERY_HIGH);
//Prevent items and gold from being dropped
int iCounter;
object oItem;
for (iCounter = 0; iCounter <= NUM_INVENTORY_SLOTS; iCounter++)
{
oItem = GetItemInSlot(iCounter, oClone);
SetDroppableFlag(oItem, FALSE);
SetItemCursedFlag(oItem, TRUE);
}
oItem = GetFirstItemInInventory(oClone);
while(GetIsObjectValid(oItem))
{
SetDroppableFlag(oItem, FALSE);
SetItemCursedFlag(oItem, TRUE);
oItem = GetNextItemInInventory(oClone);
}
TakeGoldFromCreature(GetGold(), oClone, TRUE);
}
You may want to add a few things like maybe a ForceRest so the clone gets all its spells and hit points. And a DetermineCombatRound if the clone doesn't attack right away.
-420