Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class Class1
- {
- public List<string> coloursUp = new List<string>(
- "<color=#DA0A0A>", "<color=#D7DA0A>",
- "<color=#78DA0A>", "<color=#0FDA0A>",
- "<color=#0ADA5A>", "<color=#0ADAC3>",
- "<color=#0A99DA>", "<color=#0A25DA>",
- "<color=#530995>");
- public string formatName;
- public string _c = "</color>";
- // name = player.displayName;
- string[] convertToArray(string name)
- {
- string[] characters = new string[name.Length];
- for (int i = 0; i < name.Length; i++)
- {
- characters[i] = name[i].ToString();
- }
- }
- string addColourToName(string playerName)
- {
- string[] chars = convertToArray(playerName);
- int i = 0;
- int b = 0;
- int c = 0;
- Loop:
- for (i = b; i < playerName.Length; i++)
- {
- formatName += $"{coloursUp[i-b]}{chars[i+b]}{_c}";
- if (i > coloursUp.Count)
- { c++; break; }
- }
- if (i < playerName.Length)
- { b = (coloursUp.Count*c); goto Loop; }
- return formatName;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement