"Unable to find module for asset id" error, I saw that this is caused because the module is called "ModuleScript" or something else and it should be named "MainModule". But my module is named "MainModule" and I'm still getting the error. HTTP Services are on, can anyone help please?

PS: The module, when required on the account that has published it works completely fine, doesn't work if another account requires the same module

local module = {}

local plr = game:GetService("Players").LocalPlayer

if script.Parent:FindFirstChild("lightChangeRE") then
	script.Parent:WaitForChild("lightChangeRE").Parent = game:GetService("ReplicatedStorage")
end

local lightChangeRE = game:GetService("ReplicatedStorage"):WaitForChild("lightChangeRE")


--// functions

lightChangeRE.OnServerEvent:connect(function(plr, event, selcolor, light, EC, BC, FC, ALL, brightness, speed)

toggle = false



--[[
	
if event == "lightChangeRainbow" then
	for i,v in pairs(light:GetChildren()) do
					spawn(function()
		while true do
			wait()
			 local start = v:WaitForChild("MainLight").Color
             local End = Color3.new(math.random(),math.random(),math.random())
            for i = 0,1,speed do
	wait()
                local color = start:lerp(End,i)
                v:WaitForChild("MainLight").Color = color
                v.Color = color
    			 end

start = End
		end
		end)
	end
end

--]]


if event == "lightChangeRainbow" then
	toggle = true
	for i,v in pairs(light:GetChildren()) do
					spawn(function()
		while true do
			if toggle == true then
			wait()
			 local start = v:WaitForChild("MainLight").Color
             local End = Color3.new(math.random(),math.random(),math.random())
            for i = 0,1,speed do
	wait()
                local color = start:lerp(End,i)
                v:WaitForChild("MainLight").Color = color
                v.Color = color
    			 end
			elseif toggle == false then
				break
		
			end
			
		end
		end)
	end
	end




end)
return module

5 comments

0

Can anyone help me on this?

0

Maybe if you posted the script. We don't read minds.

0

Updated.

0

Show the script that require()'s it?

0

does it work in game on other accounts?