PDA

View Full Version : [TSL]Script check for droid/robot


Malxados
04-13-2009, 05:29 PM
I was hoping to edit my script so that it should do something only if the object is a droid/robot, but I wasn't sure how to make it check that.

Thanks,
Malxados

Exile007
04-14-2009, 12:55 AM
I was hoping to edit my script so that it should do something only if the object is a droid/robot, but I wasn't sure how to make it check that.

Thanks,
Malxados

Something like this would work if it was an action script or something.

void main() {

object oDroid=GetObjectByTag("TAG_NAME_HERE");

if(GetRacialType(oDroid) == 5) {

//Is a droid! Do whatever you want here!
}
}

or if it was checking for dialog...

int StartingConditional() {

object oDroid=GetObjectByTag("TAG_NAME_HERE");

if(GetRacialType(oDroid) == 5) {
return TRUE;
}
return FALSE;
}

Nirran
04-14-2009, 01:34 AM
this is what i did for a custom loot script


if(GetRacialType(OBJECT_SELF) == RACIAL_TYPE_DROID) {
do stuff;
}

Malxados
04-14-2009, 04:12 PM
Ahh....racial type....thaknks guys. I'll try it out soon (hopefully).