Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local TextService = game:GetService("TextService")
- function rainbowifyText(text)
- local rainbowColors = {
- Color3.fromRGB(255, 0, 0),
- Color3.fromRGB(255, 127, 0),
- Color3.fromRGB(255, 255, 0),
- Color3.fromRGB(0, 255, 0),
- Color3.fromRGB(0, 0, 255),
- Color3.fromRGB(75, 0, 130),
- Color3.fromRGB(148, 0, 211)
- }
- local rainbowText = ""
- local characters = string.split(text, "")
- for i, char in ipairs(characters) do
- local rainbowColor = rainbowColors[(i % #rainbowColors) + 1]
- rainbowText = rainbowText .. "<font color=\"rgb(" .. rainbowColor.R .. ", " .. rainbowColor.G .. ", " .. rainbowColor.B .. ")\">" .. char .. "</font>"
- end
- return rainbowText
- end
- game.Players.PlayerAdded:Connect(function(player)
- player.Chatted:Connect(function(message)
- local rainbowMessage = rainbowifyText(message)
- game:GetService("ReplicatedStorage").DefaultChatSystemChatEvents.SayMessageRequest:FireServer(rainbowMessage, "All")
- end)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement