Given attribute lost on the way

Hi, this has happened to me before and I have no idea why:
Serverscript:

game.Players.PlayerAdded:Connect(function(player)
	print("PlayerAdded: ",player) --PlayerAdded: Misterx114
	local retur = secundaryModule.AddPlayer(player) 
[...]

Module Script:

local secundary = {}
function secundary:AddPlayer(player)
	local re = false
	print("AddPlayer: ",player) -- AddPlayer: nil
[...]

The given attribute is simply lost on the way, while it works for the same functions written the same way, called the same way, I am at a loss.

That’s probably because you wrongly called the module function, as the function use β€œ:” you also need to use β€œ:” when calling it, without it the given argument return nil.

local retur = secundaryModule:AddPlayer(player) 
1 Like

Oh, somehow i feel slightly stupid nowπŸ˜…

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