PDA

View Full Version : give mutiple item script problem


rgdelta
08-13-2005, 08:04 PM
I have at the end of a dialog a script that runs that gives a bunch of items to the pc script is here.

void main() {
object oItem=CreateItemOnObject( "se_revan_robe", GetFirstPC());
object oItem=CreateItemOnObject( "se_revan_dblsbr1", GetFirstPC());
object oItem=CreateItemOnObject( "se_revan_light1", GetFirstPC());
object oItem=CreateItemOnObject( "se_revan_short1", GetFirstPC());
object oItem=CreateItemOnObject( "se_can_armor", GetFirstPC());
object oItem=CreateItemOnObject( "se_bast_robe", GetFirstPC());
object oItem=CreateItemOnObject( "se_bast_dblsbr1", GetFirstPC());
object oItem=CreateItemOnObject( "se_bast_light1", GetFirstPC());
object oItem=CreateItemOnObject( "se_bast_short1", GetFirstPC());
}


Problem is Kotor Tool gives me a error when compiling error is
jmaster2.nss(3): Error: Variable "oItem" defined multiple times in the same scope

any optimization or help would be appreciated.

ChAiNz.2da
08-13-2005, 08:08 PM
Problem is Kotor Tool gives me a error when compiling error is
jmaster2.nss(3): Error: Variable "oItem" defined multiple times in the same scope

any optimization or help would be appreciated.
oItem is a call to a variable... in your case, it wouldn't be necessary..

kill the "object oItem=" line from your script and it should work just fine :)

void main() {
CreateItemOnObject( "se_revan_robe", GetFirstPC());
CreateItemOnObject( "se_revan_dblsbr1", GetFirstPC());
CreateItemOnObject( "se_revan_light1", GetFirstPC());
CreateItemOnObject( "se_revan_short1", GetFirstPC());
CreateItemOnObject( "se_can_armor", GetFirstPC());
CreateItemOnObject( "se_bast_robe", GetFirstPC());
CreateItemOnObject( "se_bast_dblsbr1", GetFirstPC());
CreateItemOnObject( "se_bast_light1", GetFirstPC());
CreateItemOnObject( "se_bast_short1", GetFirstPC());
}

rgdelta
08-13-2005, 08:19 PM
Thanks I thought that was the issue but was not sure if I could do it without the variable reference. It worked like a charm thanks for the help and quick response.