Hi!
Making an interesting Trap here, but I can't seem to get the players for the trap.
I know I'm doing something wrong here, but I can't figure it out. The switch activates, but nothing comes. Help!
/Edward
Making an interesting Trap here, but I can't seem to get the players for the trap.
Code:
# Players gets mines under their feet.
#
# By Edward
symbols
message activated
thing player local
int i local
template mines
template magic
sound magicsnd
surface switch
int on=0 local
thing dummy local
end
#
code
activated:
If(GetSenderRef()!=switch) return;
If(on==1) return;
on=1;
SetWallCel(switch,1);
sleep(1);
for(i=0; i<=GetNumPlayers(); i=i+1);
{
player=GetPlayerThing(i);
dummy=CreateThing(magic,player);
CaptureThing(dummy);
AttachThingToThing(dummy,player);
PlaySoundThing(magicsnd,player,1,-1,10,0x80);
}
sleep(0.1);
for(i=0; i<=GetNumPlayers(); i=i+1);
{
player=GetPlayerThing(i);
dummy=CreateThing(mines,player);
}
sleep(1);
SetWallCel(switch,0);
on=0;
return;
endI know I'm doing something wrong here, but I can't figure it out. The switch activates, but nothing comes. Help!
/Edward

Well, fix these two things and the cog works fine.
![http://forums.massassi.net/html/wink.gif [http://forums.massassi.net/html/wink.gif]](http://forums.massassi.net/html/wink.gif)
![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/frown.gif [http://forums.massassi.net/html/frown.gif]](http://forums.massassi.net/html/frown.gif)
me <3 parsec