What do you want to achieve?
I want to achieve a system that encrypts data. What it does is it will keep scanning until it finds a match.
What is the issue?
It isn’t returning a value somehow.
What solutions have you tried so far?
Nothing helped.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
local function decode()
for i, char in pairs(newString) do
newKey = string.gsub(key, char, alphabet[i])
end
end
local function Choose()
while wait(.001) do
if table.find(newTable, key, 1) then
return key
elseif not table.find(newTable, key, 1) then
decode()
end
end
end
Is that your full module? You have to return a single value which is most commonly a table with your functions inside.
local module = {}
function module.decode()
for i, char in pairs(newString) do
newKey = string.gsub(key, char, alphabet[i])
end
end
function module.Choose()
while true do
if table.find(newTable, key, 1) then
return key
elseif not table.find(newTable, key, 1) then
decode()
end
wait()
end
end
return module
Are you sure the function is even being called?
Using “local function” in a module script will allow it to be called only from the module script and not externally.
Hopefully this helps.