Basically, as the title says, my decode script doesn’t work. I tried substituting finaltext with “” at the start and replacing “” in the gmatch with “.” but it didn’t work. Here’s my current code:
local decoder = require(game.ReplicatedStorage.ClientDecoder)
local textbox = script.Parent.TextBox
local textbutton = script.Parent.TextButton
local textlabel = script.Parent.TextLabel
textbutton.MouseButton1Click:Connect(function()
print("CLICKED")
local finaltext
local text = textbox.Text
local letter = string.gmatch(text, "")
for j = 1, 26 do
local key = decoder.KeyboardUp[j]
local uppercase = decoder.UpperKeywords[j]
local lowercase = decoder.LowerKeywords[j]
for i in letter do
if i == key then
finaltext = finaltext..uppercase
textlabel.Text = finaltext
if finaltext == nil then
finaltext = uppercase
else
finaltext = finaltext .. uppercase
end
end
end
end
end)
(Note: finaltext still appears as nil at the end)
Thanks for helping!