I just got into ModuleScripts as I shoot to making tech configuration easier, but I’m stuck on a constant issue.
[1] What are you trying to achieve?
Trying to simply get a variable (GroupLockEnabled & GroupID) from a module script to a normal script in workspace.
[2] What is the issue?
I keep on getting errors that include,CoreScript:20: attempt to concatenate string with nil.
[3] What are some solutions that you have tried?
I’ve tried the following:
- Looking around DevForum
- Searching around Roblox’s API
[4] Main Script
Below includes both the module and standard script.
Module Script (SystemConfig):
local Settings = {}
local Settings = {}
--Tweening
Settings.EasingStyle = Enum.EasingStyle.Linear --The style in which the tween will act to. ( eg. Enum.EasingStyle.Linear )
Settings.EasingDirection = Enum.EasingDirection.In --The direction of the tween. ( eg. Enum.EasingDirection.InOut )
Settings.TweenSpeed = 0.75 --The speed in which the tween will play.
--Group Lock , STARTING RIGHT HERE! \/
Settings.GroupLockEnabled = true --Restricts non-group members from using the admin board
Settings.GroupID = 10238868 --If you are using a group, replace "0" with the Group's ID.
Settings.MinRank = 255 --The minimum rank that is allowed to use the admin board
--Date and time
Settings.TimeEnabled = true --Turns on the date and time reader on the screens
Settings.GameTime = true --If gameTime is enabled, local time will be disabled
--Descriptions
Settings.Muster = [[A muster drill is currently being held, please report to Deck 5.
*This drill is REQUIRED before cruising. ]]
Settings.Offline = [[404: CONNECTION LOST]]
return {Settings = Settings}
Main Script (CoreScript)
--Settings
local Module = script.Parent.Parent:WaitForChild("SystemConfig")
local Settings = require(Module)
---MAIN VARIABLES
local Main = script.Parent.Parent.Parent.ShipScreenSystem
local Admin = Main.AdminBoard
local allScreens = Main.Screens
---OnJoinScript
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
warn([[SCREEN SYSTEM HAS SUCCESSFULLY LOADED.
GroupEnabled: ]]..Settings.GroupLockEnabled) ---ERROR HERE
if not LocalPlayer:GetRoleInGroup(Settings.GroupID) >= Settings.MinRank then
Admin:Destroy()
end
I appreciate any little help! <3