Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

My module script dosen't return correctly? No errors

ServerScript

local Mod = require(game.Workspace.ModuleScript)



while wait() do
 game.Workspace.IntValue.Value = Mod.ReturnAVal()
end

Module Script

local module = {}


function ReturnAVal()
	local Zero = 0
	
	while wait() do
		Zero = Zero + 1
return 0 
	end
	
	
end


return module

What this is supposed to do is its Intvalue is suppoesed to go up by 1 every milisecond but intvalue is always at 0

1 comment

0

Maybe it's always at zero because just put return 0

1 answer

✓ Accepted answer

You didn't properly specify the function in the modulescript.

local module = {}


function module.ReturnAVal()
    -- code
end


return module

This discussion is preserved as it was. New answers, comments, and votes are closed.