Fishy argument in modulescript function

So, I have a script and a module script, and for some reason, when I call a function in the module script, I get an extra argument in the function, which I did not put there.

Script:

local module = require(script.Parent.Module)
module.something(1,2,3)

Module script:

local module
module.something = function(one,two,three)
      print(one,two,three)
end
return module

I am worried that this is a backdoor of some sort because when I tried to print it, this showed up in my output.

Screen Shot 2020-03-25 at 4.27.54 PM

Knowing that I didn’t put that there, I then made a for loop to loop through this “table” and print out the value in the table each time it looped. this is what I saw:

Screen Shot 2020-03-25 at 4.08.45 PM

Can somebody please tell me what this is? Is it a backdoor?

EDIT: this only happens if I use a specific script to call the function.

Might be a backdoor, I suggest trying Kronos to scan your game for malicious stuff.

Try setting your module.something to module:something. For some reason, this fixed it for me when I used function module:func(args).

100% not a backdoor.

1 Like

Didn’t work for me, same thing happened.

You put
local module
in your code, did you use:

local module = {}
module.func = function(args)
-- code
end
return module

cc: @WhitexHat

This isn’t a backdoor, it is just an error with your code.


If that is the exact code in your ModuleScript you forgot to return the function and also with what you are trying to do put the function in a table to be returned. You also can’t assign functions to variables like the way you did in your code:

local module = {}

module.something = function(one,two,three)
    print(one,two,three)
end

return module

Alternatively I prefer to set my modules out like this:

local module = {}

function module.something(one,two,three)
	print(one,two,three)
end

return module
1 Like

Yes, i did. Sorry for the typo

Sorry about the typo. I’ve fixed it now.

I suggest using Ro-Defender for these types of situations.

If I’m not mistaken, this is usually normal when calling tables/arrays a certain way. Its like getting their “key” or table in a different language. If it only appears to be happening when you call the function, I believe its fine however, if you’re afraid, you can try reading the module script and seeing what it does.

Yup:

https://gyazo.com/8c229c076fd11226c792107d98f5108e

Code:

local weirdarray = {}
print(weirdarray)

local function WeirdFunction()

end

print(WeirdFunction)
2 Likes

Already answered :stuck_out_tongue:

Test it and see! It’s ugly, but it works.

In terms of the actual problem: It’s probably printing the table because you’re calling module:something with colon syntax. You didn’t show yourself doing this, but there’s no reason this code should print a table.

2 Likes