Hi im new in module scripts and im practicing it. I made 2 functions in a module script and, the first one I call works fine, the second one I call doesn't fire at all. I don't know why sinse im calling them just like the first one:
-- Script inside a part:
local Necronomicon = require(game.ServerStorage.Necronomicon)
spawn(Necronomicon.ChangingColorsLoop(script.Parent))
spawn(Necronomicon.HooverLoop(script.Parent))
-- module script called Necronomicon who the script above reffers to:
local module = {}
-- Changing colors loop using color list module--------------------------
function module.ChangingColorsLoop(part)
local colors = require(game.ServerStorage.ColorList)
while wait(2) do
part.BrickColor = colors[math.random(1, #colors)]
end
end
-- 1x1 hoovering---------------------------------------------------------
function module.HooverLoop(part) print("not")
if part:FindFirstChild("BodyAngularVelocity") == nil then
local bav = Instance.new("BodyAngularVelocity", part)
local bp = Instance.new("BodyPosition", part)
bav.AngularVelocity = Vector3.new(0,0.6,0.1)
bp.D = 2000
bp.MaxForce = Vector3.new(4000,500,4000)
bp.P = 10000
bp.Position = part.Position
end
local direction = "down"
while wait(1.5) do
if direction == "down" then
direction = "up"
part.BodyPosition.Position = part.BodyPosition.Position - Vector3.new(0,1,0)
elseif direction == "up" then
direction = "down"
part.BodyPosition.Position = part.BodyPosition.Position + Vector3.new(0,1,0)
end
end
end
return module
Nothing showing in output

10 comments
Let's try this, put some print statements in the module functions and see if any of them print out. If some of them do then that means your module functions are being called. I would do this myself but I don't have your "ColorList."
The function for the colors are working fine, but the function for hoovering is not firing.I've tried putting a print right after the function name and it doesn't print... Im lost.
I mean, you see that "print("not")" in line 14?
Ah yes, I do see the print. And After removing the color changing function I do get a print out of "not" in my console. As well the function is working and the part I have is floating?
https://gyazo.com/ad8cb9cee165efb1f7c930892f454e68
hmmmmmm thanks, so how can I define multiple functions in the same module script?
I took this method from the wiki, im seeing no difference... https://developer.roblox.com/en-us/api-reference/class/ModuleScript
You did it right.
Oh it looks like that "spawn" is not working
Try using spawn(function() YOUR FUNCTION HERE end)