I'm having problems with a cog that I made, that changes the skin of the player. When it changes you to the Sam skin, that one works, but with all of the others, it turns you into a random 3do in the level.
Thanks in advance.
Code:
symbols
message startup
message activated
thing player local
thing Frodo
thing Merry
thing Pippin
thing Legolas
thing Gimli
thing Gandalf
thing Boromir
thing Aragorn
model Frodo=ky.3do
model Sam=kyA10.3do
model Merry=kyA17.3do
model Pippin=kyI14.3do
model Legolas=kyG7.3do
model Gimli=kyA11.3do
model Gandalf=kyJ1.3do
model Boromir=kyD0.3do
model Aragorn=kyE6.3do
sound changedhi=set_hi2.wav
sound changedmed=set_med2.wav
sound changedlow=set_lo2.wav
int change=0
end
# ========================================================================================
code
startup:
player = GetLocalPlayerThing();
SetThingModel(player, Frodo);
Return;
# ========================================================================================
activated:
if(change == 0)
{
PlaySoundThing(changedlow, player, 1.0, -1, -1, 0x80);
Print("You are Sam");
SetThingModel(player, Sam);
change = 1;
}
else if(change == 1)
{
PlaySoundThing(changedlow, player, 1.0, -1, -1, 0x80);
Print("You are Merry");
SetThingModel(player, Merry);
change = 2;
}
else if(change == 2)
{
PlaySoundThing(changedlow, player, 1.0, -1, -1, 0x80);
Prin("You are Pippin");
SetThingModel(player, Pippin);
change = 3;
}
else if(change == 3)
{
PlaySoundThing(changedmed, player, 1.0, -1, -1, 0x80);
Print("You are Legolas");
SetThingModel(player, Legolas);
change = 4;
}
else if(change == 4)
{
PlaySoundThing(changedmed, player, 1.0, -1, -1, 0x80);
Print("You are Gimli");
SetThingModel(player, Gimli);
change = 5;
}
else if(change == 5)
{
PlaySoundThing(changedhi, player, 1.0, -1, -1, 0x80);
Print("You are Gandalf");
SetThingModel(player, Gandalf);
change = 6;
}
else if(change == 6)
{
PlaySoundThing(changedhi, player, 1.0, -1, -1, 0x80);
Print("You are Boromir");
SetThingModel(player, Boromir);
change = 7;
}
else if(change == 7)
{
PlaySoundThing(changedhi, player, 1.0, -1, -1, 0x80);
Print("You are Aragorn");
SetThingModel(player, Aragorn);
change = 8;
}
else if(change == 8)
{
PlaySoundThing(changedhi, player, 1.0, -1, -1, 0x80);
Print("You are Frodo");
SetThingModel(player, Frodo);
change = 0;
}
endThanks in advance.
"The world is neither black nor white but differing shades of gray."
-By me.
-By me.
![http://forums.massassi.net/html/smile.gif [http://forums.massassi.net/html/smile.gif]](http://forums.massassi.net/html/smile.gif)
![http://forums.massassi.net/html/wink.gif [http://forums.massassi.net/html/wink.gif]](http://forums.massassi.net/html/wink.gif)