Second “Helpful” post of the day, Here we go, Alright, so I made a module that transforms text into morse, look
-- MorseCodeModule
local MorseCodeModule = {}
-- Morse code dictionary
local morseCode = {
["A"] = ".-", ["B"] = "-...", ["C"] = "-.-.", ["D"] = "-..",
["E"] = ".", ["F"] = "..-.", ["G"] = "--.", ["H"] = "....",
["I"] = "..", ["J"] = ".---", ["K"] = "-.-", ["L"] = ".-..",
["M"] = "--", ["N"] = "-.", ["O"] = "---", ["P"] = ".--.",
["Q"] = "--.-", ["R"] = ".-.", ["S"] = "...", ["T"] = "-",
["U"] = "..-", ["V"] = "...-", ["W"] = ".--", ["X"] = "-..-",
["Y"] = "-.--", ["Z"] = "--..",
["1"] = ".----", ["2"] = "..---", ["3"] = "...--", ["4"] = "....-",
["5"] = ".....", ["6"] = "-....", ["7"] = "--...", ["8"] = "---..",
["9"] = "----.", ["0"] = "-----",
[" "] = " "
}
function MorseCodeModule.textToMorse(text)
text = text:upper()
local morse = ""
for i = 1, #text do
local char = text:sub(i, i)
morse = morse .. (morseCode[char] or "")
if char ~= " " then
morse = morse .. " "
end
end
return morse
end
return MorseCodeModule
**Example :**
local MorseCodeModule = require(game:GetService(“ServerScriptService”).MorseCodeModule)
local text = “HELLO SKIBIDI”
local morse = MorseCodeModule.textToMorse(text)
print(morse)