2 Module Scripts in different places are interacting weird

I attempted to use a module from ReplicatedStorage in ServerScriptStorage. This should work as ReplicatedStorage is replicated to all clients and the server. When I sent a request to generate an array it took the first variable as an array.

--First variable sent from a module in ServerScriptStorage
"TemplateBuy"
--Variable received in the first variable slot in the replicated storage function in a module script
["spawn"] = "function",
["spawn1"] = "function"
--The second variable was
"TemplateBuy"
--As far as my knowledge goes this shouldn't occur.  If I do this on the client the first variable is what it should be
--It also never sent a second variable

I want to see if this is intentional or not so I can make a bug report.

Can we see your full related code instead of just the results.

I am unable to give the full scripts but here are the functions:

--this is server script i talked of
local modgenque = require(game.ReplicatedStorage.module.QuestScript)

function module:load(player)
	quests[player.UserId] = queststore:GetAsync(player.UserId)
	if quests[player.UserId] == nil then
		quests[player.UserId] = {}
	else
		for i=1,table.getn(quests[player.UserId]),1 do
			if quests[player.UserId][i][2] == true then
                --The line below this called the rep storage script
				local temp = modgenque:spawn1(quests[player.UserId][i][1])
				modlog:actque(player, temp, true)
			end
		end
	end
end
--Replicated storage script
function module.spawn1(que2, trash)
--More of this is unnecesary but basically it is sending an array in the first slot and not a string

For your knowledge if I call the function it has two variables go into the first post for more info.

I take it quests[player.UserId][i][1] is a string?

If you’re trying to pass that value as the first parameter in the module.spawn1 function, then you should call it using modgenque.spawn1() rather than modgenque:spawn1().

The difference between the notation is that :spawn1() will pass the table as the first parameter, whereas .spawn1() will not.

1 Like

I just noticed that. I thought I made all my scripts with a : and not .
Thank you.