Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

My module script dosen't return correctly? No errors

Asked by 4 years ago

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

0
Maybe it's always at zero because just put return 0 sheepposu 561 — 4y

1 answer

Log in to vote
1
Answered by 4 years ago
Edited 4 years ago

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

local module = {}


function module.ReturnAVal()
    -- code
end


return module

Ad

Answer this question