I've been working on a script that fires on a creatures on spawn event to give random body parts, skin color, hair etc.
So far I'm only testing the head part. The script compiles fine but only gives the last random head in a sequence. For example: if I have 12 heads availiable, it always picks the 12th. If I have 6, it always picks the 6th. I feel like there's something extremely obvious I'm overlooking and I would appreciate any input you can give me.
//Random Head Script
void main()
{
switch(Random(12))
{
case 0: SetCreatureBodyPart(CREATURE_PART_HEAD, 1, OBJECT_SELF);
case 1: SetCreatureBodyPart(CREATURE_PART_HEAD, 2, OBJECT_SELF);
case 2: SetCreatureBodyPart(CREATURE_PART_HEAD, 3, OBJECT_SELF);
case 3: SetCreatureBodyPart(CREATURE_PART_HEAD, 4, OBJECT_SELF);
case 4: SetCreatureBodyPart(CREATURE_PART_HEAD, 5, OBJECT_SELF);
case 5: SetCreatureBodyPart(CREATURE_PART_HEAD, 6, OBJECT_SELF);
case 6: SetCreatureBodyPart(CREATURE_PART_HEAD, 7, OBJECT_SELF);
case 7: SetCreatureBodyPart(CREATURE_PART_HEAD, 8, OBJECT_SELF);
case 8: SetCreatureBodyPart(CREATURE_PART_HEAD, 9, OBJECT_SELF);
case 9: SetCreatureBodyPart(CREATURE_PART_HEAD, 10, OBJECT_SELF);
case 10: SetCreatureBodyPart(CREATURE_PART_HEAD, 11, OBJECT_SELF);
case 11: SetCreatureBodyPart(CREATURE_PART_HEAD, 12, OBJECT_SELF);
case 12: SetCreatureBodyPart(CREATURE_PART_HEAD, 13, OBJECT_SELF);
}
}
Modifié par Snarkblat, 26 juin 2011 - 05:53 .