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

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

Asked by 9 years ago
--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?)

0
You need to provide more detail. What doesn't work? What do you expect it to do, and what is it doing? TaslemGuy 211 — 9y
0
I think its pretty self explanatory, oh well. Illl try to edit it. Orlando777 315 — 9y
0
Wouldn't you need to put "S.Settings.GunType.Semi"... ? i.e. Why are you skipping referring to "Settings"? duckwit 1404 — 9y
0
Actually, I'm not sure of the syntax/workings of module scripts. Is it supposed to be "module.Settings = " rather than just "Settings ="...? duckwit 1404 — 9y
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. Orlando777 315 — 9y

1 answer

Log in to vote
-1
Answered by 9 years ago

Does the the modulescript exist in Workspace?

0
Yes. Orlando777 315 — 9y
Ad

Answer this question