PDA

View Full Version : Script need help


sekan
06-14-2007, 09:10 AM
I need help with some scripting on k1. I'm very new on kotor modding and my english is not very good so i dont understand so mutch.


void main()
{
AdjustAlignment( GetFirstPC(),ALIGNMENT_LIGHT_SIDE, 2);
object oItem=CreateItemOnObject ( "tat18_dragonprl", GetFirstPC());
TakeGoldFromCreature( GetFirstPC(),2000);
}


I know there is something wrong with TakeGoldFromCreature but i dont know what's wrong.

Master Zionosis
06-14-2007, 09:32 AM
Give this a go, its a little rough but it does the job:

void main()
{
object me = GetFirstPC();
AdjustAlignment( GetFirstPC(),ALIGNMENT_LIGHT_SIDE, 2);
object oItem=CreateItemOnObject ( "tat18_dragonprl", GetFirstPC());
TakeGoldFromCreature(2000, me, TRUE);
}

Post if you have more problems :)

stoffe
06-14-2007, 09:50 AM
I know there is something wrong with TakeGoldFromCreature but i dont know what's wrong.

The problem is the order of the parameters you specified to it. The TakeGoldFromCreature() function takes two required parameters and one optional parameter. First you specify the amount of credits to take, second you specify the object to take the credits from. The third optional parameter lets you decide if the credits is added to the inventory of the object running the script (if it has one), or if it's just destroyed. If the parameter is left out it defaults to FALSE, i.e. the credits will be added to the inventory of the script owner.

The function prototypes for all the standard NWScript functions are listed inside the nwscript.nss file (found inside scripts.bif, you can look in this file to determine what parameters you need to specify for a particular function.

sekan
06-14-2007, 10:45 AM
Thanks it works now