Copy salient and essential scripts and models from Plane Building Roblox
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
NAME_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,
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
local color_offset = 0
|
||||
function ComputeNameColor(pName)
|
||||
return NAME_COLORS[((GetNameValue(pName) + color_offset) % #NAME_COLORS) + 1]
|
||||
end
|
||||
|
||||
return getfenv()
|
||||
Reference in New Issue
Block a user