Function printing the value but returning nil

Hey, Im making some random stuff using modules for fun and I noticed something that even after 1 hour of searching I couldn’t find anything to solve.

Well, theres a function that generates a code, splits it, do a lot math and gives a result… “_TKEY”, when I print the result the output is the value normally, but when I use return, it returns nil.

ModuleScript function

The problem is:
image

Script in SSS
image

Outputs
image

Can anyone help me with this?

2 Likes

Hey i just copied your code into studio and it works perfectly fine for me when authorized is true, but when it’s false its returning nil so the problem may be the functions guard clause. :man_shrugging:

Screenshot 2023-11-28 223407

2 Likes

How about returning {_TKEY} instead?

Or consider returning {Crypto = Crypto}?

1 Like

I tried returning the values in a table but still it returns nil.
Both ways still returns nil.

Well, the function indeed returns nil when it is not authorized, but it is getting authorized and runs perfectly, it just returns nil.

after some tests I realized that the problem was the way I was calling it in the main module, so I solved it and now it is working.
Thank you anyways.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.