|
| 26 Feb 2017 09:47 PM |
local function GetNameValue( pName ) local value = 0 for index = 1, #pName do local cValue = string.byte( string.sub( pName, index, index ) ) local reverseIndex = #pName - index + 1 if #pName % 2 == 1 then reverseIndex = reverseIndex - 1 end if reverseIndex % 4 >= 2 then cValue = - cValue end value = value + cValue end return value end
function Util.ComputeChatColor( pName ) return CHAT_COLORS[ ( GetNameValue( pName ) % #CHAT_COLORS ) + 1] end |
|
|
| Report Abuse |
|
|
|
| 26 Feb 2017 10:29 PM |
| How nice of you to post a huge chunk of code without any insight at all on how it works to answer something a quick google search would have revealed. |
|
|
| Report Abuse |
|
|
|
| 26 Feb 2017 10:31 PM |
^
Certain people aren't meant for certain jobs. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 26 Feb 2017 10:55 PM |
| Literally as easy as looking in the core scripts but ok |
|
|
| Report Abuse |
|
|
Wrathsong
|
  |
| Joined: 05 Jul 2012 |
| Total Posts: 22393 |
|
|
| 26 Feb 2017 11:02 PM |
well this has already been discovered
Ever wanted to learn how to script? Check out my YouTube channel: youtube.com/ausbtintheslayer Want to see me code in action? Follow me on twitch: twitch.tv/austinrblx |
|
|
| Report Abuse |
|
|
|
| 26 Feb 2017 11:30 PM |
i heard a lot of people trying to find this before so i thought i would add more publicity basically cvalue is the character byte at that point in the string
so during the for loop with my name
byte of W byte of u byte of n ...
reverse index would just be how far that character is down the string + 1 so 12 11 10 ...
if the amount of characters is not divisible by 2 then lower that by 1
if it mod 2 is greater than or equal to 2 then make the byte negative then add that changed cvalue to value
and then it just picks a color, making sure that it stays within the amount of colors if it goes over
looks like just random math tbh to me
|
|
|
| Report Abuse |
|
|
|
| 26 Feb 2017 11:40 PM |
if you guys would like the colors
local CHAT_COLORS = { Color3.new(253/255, 41/255, 67/255), -- BrickColor.new("Bright red").Color, Color3.new(1/255, 162/255, 255/255), -- BrickColor.new("Bright blue").Color, Color3.new(2/255, 184/255, 87/255), -- BrickColor.new("Earth green").Color, BrickColor.new("Bright violet").Color, BrickColor.new("Bright orange").Color, BrickColor.new("Bright yellow").Color, BrickColor.new("Light reddish violet").Color, BrickColor.new("Brick yellow").Color, }
all i did was pick apart a module inside my folders |
|
|
| Report Abuse |
|
|
|
| 26 Feb 2017 11:41 PM |
Also btw idk if this is some secret but Interns and Admins at ROBLOX get their own chat colors.
this.Settings = { ... AdminTextColor = Color3.new(1, 215/255, 0); InternTextColor = Color3.new(175/255, 221/255, 1); ... }
and
if PlayerPermissionsModule.IsPlayerAdminAsync( this.SendingPlayer ) then chatMessage.TextColor3 = this.Settings.AdminTextColor elseif PlayerPermissionsModule.IsPlayerInternAsync( this.SendingPlayer ) then chatMessage.TextColor3 = this.Settings.InternTextColor end |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 26 Feb 2017 11:53 PM |
| "Literally as easy as looking in the core scripts but ok" |
|
|
| Report Abuse |
|
|
| |
|
|
| 26 Feb 2017 11:57 PM |
| whats up with these avatar editor and lobby3d places inside my files though, they are in a folder called places inside content, i found them pretty strange and the editor wont fit on my screen correctly |
|
|
| Report Abuse |
|
|