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

Why does this Module script not work? .-. (Not Answered)

--Module
local Settings = {	GunType = {Semi = true;Auto = false;Burst = false;Shot = false;Explosive = false;}}

return Settings
--Localscript
local S = require(game.Workspace.ModuleScript)
print(S.GunType.Semi)

I cant print (S.GunType.Semi), it throws and error at me stating that guntype is not defined, a nil value (Which is why I'm referring to a module script...right?)

5 comments

0

You need to provide more detail. What doesn't work? What do you expect it to do, and what is it doing?

0

I think its pretty self explanatory, oh well. Illl try to edit it.

0

Wouldn't you need to put "S.Settings.GunType.Semi"... ? i.e. Why are you skipping referring to "Settings"?

0

Actually, I'm not sure of the syntax/workings of module scripts. Is it supposed to be "module.Settings = " rather than just "Settings ="...?

0

According to the WIKI Settings is the module itself, therefore there is no need to address it. I tried it your way as well, and it doesn't work.

1 answer

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