How do I assign a player a random color when they log in and noone else could get that color unless the person who has the color leaves?
The colors are: ("Red","Yellow","Green","Blue","Cyan","Purple","Orange","Gray")
ID:268937
Dec 30 2004, 5:39 pm
|
|
In response to Wizkidd0123
|
|
That isnt what he wants..
|
In response to Dession
|
|
Dession wrote:
That isnt what he wants.. *Rereads his post* Oops: I'll edit my post. |
In response to Wizkidd0123
|
|
Uhm, I dont want it like that :( I put a list of colors I want it to choose from
|
Try this(Untested)
mob/var/Color I'm not sure if it'll work but it's worth a try. |
In response to Artekia
|
|
Well errm this is what I have done myself, Would it work?
mob |
In response to Skye Reaver
|
|
NO.
First, if GetColor fails, it returns nothing, and you get a blank entry in the list. If GetColor() gets spawn'd(), it has no one to return to. Second, I don't like "if("[Color]" in Colors)". I doubt that will work. Try if(Colors.Find("[Color]")) I'd change Login() to merely call GetColor, and move the Colors+= and world << lines to GetColor. |
In response to Nova2000
|
|
Be careful you don't make an endless loop once all the colors are taken!
|
[EDIT]
You would do it like this