iim trying to make a code that knows me for my key and changes my icon to what i tell it to.I get an error, heres the code:
if(src.key = "Scoobert" )
icon = 'person.dmi'
icon_state = "King Scoobert"
heres the error:
login.dm:55:error::missing expression
ID:150011
Jan 5 2002, 5:16 pm
|
|
In response to Darkness
|
|
oh ok ill try now
|
In response to Scoobert
|
|
wow your da man, ok so realy im da man but thanks little errors get me everytime
|
In response to Scoobert
|
|
It still doesnt work its just theres no error
|
In response to Scoobert
|
|
Scoobert wrote:
It still doesnt work its just theres no errortry if(client.key == "Key") it might work better than src.key. |
In response to Darkness
|
|
Hmm there must be something wrong
|
In response to Super16
|
|
Super16 wrote:
Whats wrong is you forgot src.Um..what are you talking about? Scoobert used src in his code. and Key is a client var anyhow. |
In response to Darkness
|
|
Darkness wrote:
Super16 wrote: No he just put icon= you need src.icon |
In response to Darkness
|
|
Key is a client var because only mobs with clients attached can have keys.
|
In response to Super16
|
|
I though you were talking about the if statement, and you don't always need src., it depends how the rest of the code is really, or where he puts it.
|
In response to Super16
|
|
if(src.key = "Scoobert" )
thats dm 55 but thats not a problem now that i put the == but nothing you have put on here helps |
In response to Super16
|
|
Super16 wrote:
No he just put icon= you need src.icon No, you dont. It defaults to src Alathon |
In response to Scoobert
|
|
I suggest using this code temporarily, and then examining the error messages you get:
if(src.key == "Scoobert") What this should do is either tell you it's changing the icon, or that it can't because your key doesn't match (and it will tell you which key you're using). This could be as simple as the icon not existing in the right file or having its icon state named incorrectly. In fact, I'd bet that the problem is likely that your icon state is misspelled or that you have the name in lowercase like "king scoobert", so the code is using the default icon in person.dmi instead of yours. Lummox JR |
maybe try putting two ='s in your if.