ID:1923694
 
(See the best response by Nathanok.)
Code:
for(M in CTFMembers)
M.Team=pick("Red","Blue")
if("Red")
if(M.Team=="Blue")return
M.Team="Red"
M.overlays.Add('CTF Red.dmi')
if(RedTeam)RedTeam="[RedTeam], [M]"
else RedTeam="<b><font color=#FF0000>Red Team: [M]"
if("Blue")
if(M.Team=="Red")return
M.Team="Blue"
M.overlays.Add('CTF Blue.dmi')
if(BlueTeam)BlueTeam="[BlueTeam], [M]"
else BlueTeam="<b><font color=#0099FF>Blue Team: [M]"
world<<"[BlueTeam]<br>[RedTeam]"


Problem description:
Okay currently the way I have it coded, it won't add anyone to the teams. It'll start but no one gets added to a team. I did have it working before where it'd add you to a team but it was always Red or Blue it wouldnt split the players.

the indentation is wrong isnt it

for(M in CTFMembers)
M.Team=pick("Red","Blue")
switch(M.Team)
if("Red")
M.overlays.Add('CTF Red.dmi')
if(RedTeam)RedTeam="[RedTeam], [M]"
else RedTeam="<b><font color=#FF0000>Red Team: [M]"
if("Blue")
M.overlays.Add('CTF Blue.dmi')
if(BlueTeam)BlueTeam="[BlueTeam], [M]"
else BlueTeam="<b><font color=#0099FF>Blue Team: [M]"
world<<"[BlueTeam]<br>[RedTeam]"
In response to Nathanok
It says pick is undefined proc if I indent the if statements.
Best response
cause you didn't switch M.Team
In response to Nathanok
Nathanok wrote:
cause you didn't switch M.Team

I just noticed I didn't use switch! Wow I am blind lol, thanks!