mob
White_Team
icon = 'teammates.dmi'
icon_state = "white"
Red_Team
icon = 'teammates.dmi'
icon_state = "red"
Blue_Team
icon = 'teammates.dmi'
icon_state = "blue"
Login()
var/red = /mob/Red_Team
var/blue = /mob/Blue_Team
..()
src << "Welcome to TrapWar! Pick your team."
world << "[src.key] is picking \his character!"
switch(alert("What is your team?","Team Selection","Red","Blue","Cancel"))
if("Red")
src.client.mob = red
src.team = "Red"
src.loc = locate(3,24,1)
if("Blue")
src.client.mob = blue
src.team = "Blue"
src.loc = locate(39,24,1)
if("Cancel")
world << "[src.key] decided not to play."
del(src)
src.name = input("What is your name?","Name") as text
usr << "Welcome to the [usr.team] base! Destroy or capture all of the other team to win!"
world << "[src.team] Teammate [src.name] has logged on!"
Logout()
..()
world << "[usr.team] Teammate [src.name] has logged out."
var
team = null
Problem description:
The code compiles just fine, but whenever I run it, it gives me this error:
runtime error: bad client
proc name: Login (/mob/Login)
usr: Guest (/mob/White_Team)
src: Guest (/mob/White_Team)
call stack:
Guest (/mob/White_Team): Login()
I've tried changing the code many times, always doing the same basic thing, but it never works.
What's wrong?!