My Module Script Isn't Working Properly

My module script is meant to print bombs or missiles when that gamemode is chosen, but it isn’t working.

Module Script:

local module = {}

function module:Bombs()
	print("Bombs")
end

function module:Missiles()
	print("Missiles")

end

return module

The Script Calling It:

local MyModule = require(game:GetService("ReplicatedStorage"):FindFirstChild("GameModes"))
					if SelectedMap == Map2 then
		if game.ReplicatedStorage.Gamemodes.Vote2.Value == "Bombs" then
			MyModule:Bombs()
		elseif game.ReplicatedStorage.Gamemodes.Vote2.Value == "Missile" then
			MyModule:Missiles()
		end
		end

When it picks bombs, it works perfectly fine, but it has favouritism to bombs. But when it picks missiles, the module script doesn’t work. Any help would be appreciated.

Have you tried tried replacing the MyModule:Missiles() with a simple print to be sure its not the module?

I realised the problem now, you are right thanks! I put “missile” instead of “missiles”, if it works then I will put you as the solution.

Edit: Just worked.

1 Like