ID:272289
 
Anyone know how to make a character selection screen so it shows a closed icon when the character isn't unlocked and an open icon if the character is unlocked, I already got this done, but I'm pretty sure that the character unlocked state will show up to everyone. So, any help with this? Heres my current code.

    Sonic
icon = 'mob.dmi'
icon_state = "selection2"
Click()
if(usr.unlockedsonic)
usr << "You have chosen sonic"
usr.icon = 'mob.dmi'
usr.loc = locate(11,14,1)
else
switch(alert("Sonic has not been unlocked yet, do you wish to unlock him as a playable?","2500 Tokens: Unlock Sonic?","Yes","No"))
if("Yes")
if(usr.Tokens >= 0)
usr.Tokens -= 0
usr.unlockedsonic = 1
usr << "You have unlocked sonic!"
src.icon_state = "selection"
if(client.unlockedsonic)
icon_state = "unlocked"
else icon_state = "locked"


You should make locked/unlocked a client var. I would do that, if no one told me a better way.
In response to Subzero1
but wouldnt that show up wrong if more than one person is on the login screen at a time and they have different unlocked characters? I would think that making a hud that goes away after the login screen would be best. if you dont know how to make a hud just look for demos theres alot of good ones (thats how i learned)
In response to Gorrek
Reference :

Client

"Each connected player has a corresponding client object."

So no, it wouldn't mess or shouldn't mess if more than 1 client is at the login screen, since they are different clients.
In response to Subzero1
Actually, he is right, if you have your character screen set up on a map like that. The fact you've made a client variable is irrelevant. You're changing the icon of the atom (probably /turf), which is visible equally to all players.
In order to make a player see something other players don't, you need to use either screen objects or images. There are also other ways like invisibility, but they're for quite a different purpose.
In response to Kaioken
K thanks for everyones help I got a hud for it set up.