i have this modulescript and localscript, and when the modulescript function is running it should print running, but it doesnt say anything, here is my code:
--localscript code:
local myModule = require(workspace.KeyHandler)
game:GetService("UserInputService").InputBegan:connect(myModule.onKeyPress())
--modulescript code:
local module = {}
function module.onKeyPress(inputObject, gameProcessedEvent)
print("running...")
if inputObject.KeyCode == Enum.KeyCode.Space then
print("Spacebar was pressed")
if(_G.wt1 == true) then
_G.wt1 = false
_G.WelcomeText2()
elseif(_G.wt3 == true) then
_G.wt3 = false
_G.WelcomeText4()
end
end
end
return module
if anyone could figure this out I would be grateful, thanks in advance!

1 comment
It worked, thank you.