generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Chat colour of player solution

Previous Thread :: Next Thread 
noliCAIKS is not online. 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
MrgamesNwatch is not online. MrgamesNwatch
Joined: 02 Feb 2009
Total Posts: 7729
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
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
05 Sep 2012 03:03 PM
Works for me and my alt. Good job :D
Report Abuse
TheCapacitor is not online. TheCapacitor
Joined: 19 Jan 2011
Total Posts: 7045
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
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
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 is not online. Legend26
Joined: 08 Sep 2008
Total Posts: 10586
05 Sep 2012 03:23 PM
Worked for me and two alts. Nice.
Report Abuse
Quenty is not online. 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 is not online. 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
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
05 Sep 2012 04:19 PM
Telamon and Shedletsky are actually two different accounts somehow.
Report Abuse
JulienDethurens is not online. JulienDethurens
Joined: 11 Jun 2009
Total Posts: 11046
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
Shedletsky is not online. Shedletsky
Joined: 21 Jun 2006
Total Posts: 9114
05 Sep 2012 05:09 PM
Pretty close. Very impressive.
Report Abuse
ihaveamac is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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
JulienDethurens is not online. JulienDethurens
Joined: 11 Jun 2009
Total Posts: 11046
05 Sep 2012 05:20 PM
Shedletsky, tell us how it's done. Please.
Report Abuse
Shedletsky is not online. Shedletsky
Joined: 21 Jun 2006
Total Posts: 9114
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 is not online. 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 is not online. agent767
Joined: 03 Nov 2008
Total Posts: 4181
05 Sep 2012 05:46 PM
^same for me
Report Abuse
mew903 is not online. 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 is not online. agent767
Joined: 03 Nov 2008
Total Posts: 4181
05 Sep 2012 05:48 PM
^yup
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image