noliCAIKS
|
  |
| Joined: 08 Mar 2010 |
| Total Posts: 917 |
|
|
| 05 Sep 2012 02:38 PM |
I think I saw someone asking this some time ago, and I wondered myself too back in 2009. I decided to give it another go, and solved the problem this time. I'm very tired now, so I'll explain later. Just post any questions you have and I'll check this thread later.
do local PlayerColours = { BrickColor.new("Bright red"), BrickColor.new("Bright blue"), BrickColor.new("Earth green"), BrickColor.new("Bright violet"), BrickColor.new("Bright orange"), BrickColor.new("Bright yellow"), BrickColor.new("Light reddish violet"), BrickColor.new("Brick yellow"), } local GetNameValue
function GetChatColour(Name) return PlayerColours[GetNameValue(Name) + 1] end
function GetNameValue(Name) local Length = #Name local Value = 0 for Index = 1, Length do local CharacterValue = string.byte(string.sub(Name, Index, Index)) if (Length - Index + 1) % 4 < 2 then Value = Value + CharacterValue else Value = Value - CharacterValue end end return Value % 8 end end
print(GetChatColour("ss1122")) -- Bright red print(GetChatColour("noliCAIKS")) -- Bright violet |
|
|
| Report Abuse |
|
|
|
| 05 Sep 2012 02:45 PM |
ah well, here's a list of names you can try that out on http://www.roblox.com/Forum/ShowPost.aspx?PostID=67681722 |
|
|
| Report Abuse |
|
|
|
| 05 Sep 2012 03:03 PM |
| Works for me and my alt. Good job :D |
|
|
| Report Abuse |
|
|
|
| 05 Sep 2012 03:08 PM |
| Try entering "Telamon" - it's incorrect, because Telamon's chat color is bright orange. Close though, as it got my name and LocalChum's name correct. |
|
|
| Report Abuse |
|
|
|
| 05 Sep 2012 03:09 PM |
| Telamon just changed his. If it works for everybody else, then the only thing to assume is that his favourite colour is orange :3 |
|
|
| Report Abuse |
|
|
Legend26
|
  |
| Joined: 08 Sep 2008 |
| Total Posts: 10586 |
|
|
| 05 Sep 2012 03:23 PM |
| Worked for me and two alts. Nice. |
|
|
| Report Abuse |
|
|
Quenty
|
  |
| Joined: 03 Sep 2009 |
| Total Posts: 9316 |
|
|
| 05 Sep 2012 03:57 PM |
How did you figure it out?
That's cool. xD
It worked for my user. |
|
|
| Report Abuse |
|
|
Seranok
|
  |
| Joined: 12 Dec 2009 |
| Total Posts: 11083 |
|
|
| 05 Sep 2012 03:58 PM |
| Would Telamon's name not working have anything to do with his name change? |
|
|
| Report Abuse |
|
|
|
| 05 Sep 2012 04:19 PM |
| Telamon and Shedletsky are actually two different accounts somehow. |
|
|
| Report Abuse |
|
|
|
| 05 Sep 2012 04:54 PM |
print(GetChatColour("JulienDethurens")) -- Brick yellow
My chat color is blue. I'm afraid you got it wrong. :(
I really want to know how these are calculated... please, some dev? |
|
|
| Report Abuse |
|
|
|
| 05 Sep 2012 05:09 PM |
| Pretty close. Very impressive. |
|
|
| Report Abuse |
|
|
ihaveamac
|
  |
| Joined: 27 Jan 2009 |
| Total Posts: 7511 |
|
|
| 05 Sep 2012 05:10 PM |
I've seen someone do this in a private model, it matched my color. Forgot what model. This is cool though. C:
~iham |
|
|
| Report Abuse |
|
|
Seranok
|
  |
| Joined: 12 Dec 2009 |
| Total Posts: 11083 |
|
|
| 05 Sep 2012 05:11 PM |
Here's the full code:
function GetNameValue(Name) if (Name == "Telamon") return 4 end ... end
|
|
|
| Report Abuse |
|
|
NB3
|
  |
| Joined: 27 Dec 2009 |
| Total Posts: 537 |
|
|
| 05 Sep 2012 05:11 PM |
| I'm sure roblox just added that in for design. |
|
|
| Report Abuse |
|
|
Flurite
|
  |
| Joined: 03 Apr 2011 |
| Total Posts: 5386 |
|
|
| 05 Sep 2012 05:13 PM |
| Is there any reason for the 'do' statement? |
|
|
| Report Abuse |
|
|
Seranok
|
  |
| Joined: 12 Dec 2009 |
| Total Posts: 11083 |
|
|
| 05 Sep 2012 05:15 PM |
| It creates a scope, so that the variables declared locally will not be accessible outside of teh scope. It's the closest thing to a class in Lua. |
|
|
| Report Abuse |
|
|
Flurite
|
  |
| Joined: 03 Apr 2011 |
| Total Posts: 5386 |
|
|
| 05 Sep 2012 05:16 PM |
| That's what I thought, but then I saw he didn't do anything much outside of the scope.. |
|
|
| Report Abuse |
|
|
Seranok
|
  |
| Joined: 12 Dec 2009 |
| Total Posts: 11083 |
|
|
| 05 Sep 2012 05:16 PM |
| He called the functions outside of the scope... |
|
|
| Report Abuse |
|
|
Flurite
|
  |
| Joined: 03 Apr 2011 |
| Total Posts: 5386 |
|
|
| 05 Sep 2012 05:19 PM |
Which is just about it and doesn't require its own scope..
but good job, it seems its quite accurate. |
|
|
| Report Abuse |
|
|
|
| 05 Sep 2012 05:20 PM |
| Shedletsky, tell us how it's done. Please. |
|
|
| Report Abuse |
|
|
|
| 05 Sep 2012 05:41 PM |
| There's a one-way hash function with some secret numbers. I don't know what else it's used for, so I don't want to post the code. Could be a security risk. |
|
|
| Report Abuse |
|
|
mew903
|
  |
| Joined: 03 Aug 2008 |
| Total Posts: 22071 |
|
|
| 05 Sep 2012 05:46 PM |
| It said bright blue for me. It's just normal blue though D: |
|
|
| Report Abuse |
|
|
agent767
|
  |
| Joined: 03 Nov 2008 |
| Total Posts: 4181 |
|
| |
|
mew903
|
  |
| Joined: 03 Aug 2008 |
| Total Posts: 22071 |
|
|
| 05 Sep 2012 05:47 PM |
| Oh, I just noticed there's no normal Blue, so I guess OP's right. |
|
|
| Report Abuse |
|
|
agent767
|
  |
| Joined: 03 Nov 2008 |
| Total Posts: 4181 |
|
| |
|