Command Bar and Module Script issue

I have a ModuleScript inside of my ServerScriptService that has a simple function that returns a dictionary from a table that’s connected to a player.

The Module:

local module = {}
local PlayerData = {}

function module.getData(plr)
	return PlayerData[plr]
end

function module.createData(plr, data)
	
	local newTable
	if data then
		newTable = data
	else
		newTable = {}
	end
	
	PlayerData[plr] = newTable
	return newTable
	
end

These functions are called when a player joins the game from a seperate script as well.

local function onPlayerJoin(plr)
   local new = EquipHandler.createData(plr, {
       Primary = "something"
   })
end

-- I connected this to a Players.PlayerAdded event

The thing is, when I go into Current: Server Mode and use this section of code in the command bar:

local module = require(game.ServerScriptService.Module)
local data = module.getData(game.Players["TheRealCybop"])

print("I am using a " .. data.Primary)

(Of course, this is all in one line.)
It shoots out an error, saying attempting to index nil as ‘Primary’.

I’m not sure as to why this happens, but this works perfectly fine when put into a normal Script. Any tips would help.

can you try print data to see what it returns, as of currently I dont have the time to test this in studio so sorry about having to ask you to do this

If I call the module.getData() function on the Server Side while using studio, printing data will return nil.

If I call the function inside of a Server Script, printing data outputs >{...}, and can drop down to reveal the contents of the table.

well the last thing i need to know is does the modue script have a return module becuase thats not shown in your script above

local module = {}
local PlayerData = {}

function module.getData(plr)
	return PlayerData[plr]
end

function module.createData(plr, data)
	
	local newTable
	if data then
		newTable = data
	else
		newTable = {}
	end
	
	PlayerData[plr] = newTable
	return newTable
	
end

it should have

local module = {}
local PlayerData = {}

function module.getData(plr)
	return PlayerData[plr]
end

function module.createData(plr, data)
	
	local newTable
	if data then
		newTable = data
	else
		newTable = {}
	end
	
	PlayerData[plr] = newTable
	return newTable
	
end

return module

now if this is just a copy paste error i can understand thats just the last thing i see as a problem

im going off to bead so i wont be able to respond for like 12 hours and i give you luck