ModuleScript values are supposedly nil

When I defined the variables in the Module Script, with their values set, somehow the value is nil.

The Script:

local config2 = require(script.Parent.Configuration))
while wait(5) do
	local parts = workspace:GetPartBoundsInBox(script.Parent.Parent:GetBoundingBox(), Vector3.new(20 + script.Parent.Size.X/2, 20 + script.Parent.Size.Y/2, 20 + script.Parent.Size.Z/2))
	for i = 1, #parts do
		local part = parts[i]
		if part ~= script.Parent then 
			if part:FindFirstChild("Configuration") and part:FindFirstChild("CurrencyType") then
				if part.CurrencyType:IsA("IntValue") and part.Configuration:IsA("ModuleScript") then
					if part.CurrencyType.Value == 2 then
						local config = require(part.Configuration)
						local multiplier = config.MultiplierValue
						local owner = config.Owner
						if owner == config2.Owner and config2.multiplier > multiplier then
							local size = math.abs(math.log10(multiplier) * 2 + math.log(multiplier))
							if size >= 5000 then
								size = math.floor
							end
							part:Destroy()
							script.Parent.Size = Vector3.new(size, size, size)
						end
					end
				end
			end
		end
	end
end

The Error:

I have printed out the multiplier and owner values of both of the modules.
config:
Screen Shot 2022-11-20 at 8.03.22 PM
config2:
Screen Shot 2022-11-20 at 8.04.33 PM

The Module Scripts:
config:

local module = {}
module.MultiplierValue = 1
module.Owner = "Server"
return module

config2:

local module = {}
module.MultiplierValue = 2
module.Owner = "Server"
return module

Most of the problems with a script not recognizing a value from a module script is solved because they forgot to return it, or they were changing it from a local script and the module wasn’t in Replicated Storage.

Shouldn’t this be config2.MultiplierValue?

1 Like

ooooooooohhhhhhh

bruhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh

1 Like

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