Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function rainbowText(text)
- -- define the colors we want in the order we want them to appear.
- -- in this case, roygbv
- local _colors = {
- colors.red,
- colors.orange,
- colors.yellow,
- colors.green,
- colors.blue,
- colors.purple
- }
- -- go through all of the letters of text
- for i=1, #text do
- local char = text:sub(i,i)
- -- set the text color to the first color in our _colors table
- term.setTextColor(_colors[1])
- -- then write the character
- write(char)
- -- send the first color of our _colors table to the end
- -- we've already used it, so we move on to the next one.
- table.insert(_colors, table.remove(_colors, 1))
- end
- end
- rainbowText("Welcome to my room, niggas")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement