Hey, I'm making a round script and I'm using a ModuleScript to store all of the settings. This is what it looks like:
local Settings = {} Intermission = 15; GameTime = 60; return Settings
This script is inside the main game script. I created variables in the main script to access these values.
--[ Game Variables Intermission = Settings.Intermission GameTime = Settings.GameTime
I did it for the actual script too ;P
--[ Modules Settings = require(script.Settings)
And I used it for the intermission like this:
if game.Players.NumPlayers >= 1 then for i = Intermission, 0, -1 do ChangeText("Intermission: " .. i) wait(1) end
And I get this error
Workspace.CoreGame:46: 'for' initial value must be a number
If I remove the Intermission after for i = and replace it with an actual number it works fine. But I want to have it connect to the settings module script
The reason is that you are not putting Intermission and GameTime in the module script. To put a variable in a module script, you would do
local Settings = {} Settings.Intermission = 15; Settings.GameTime = 60; return Settings
Your script should work then.
Hope this helps!