--ServerScript.
local Admins = {"Vezious"}
local ServerOnlyBans = false -- Allow admins to ban people not in the server with their UserId?
local ReloadTime = 300 -- 5 Minutes, Change to how many seconds it should wait between updating Bans Table
KickMessage = ("This game has shut down.") -- Default Message, You may change this.
require(script.Parent.ModuleScript)
So, what i'm trying to achieve here is to get the variables from the ServerScript and let the Module script use them. Any ideas?
--Module
script = nil
local module = {}
local Event = game.ReplicatedStorage:FindFirstChild("Bans") or Instance.new("RemoteEvent",game.ReplicatedStorage)
Event.Name = "Bans"
local BansTable = nil
function LookForIdPlayer(UserId)
end
function LookForStringPlayer(StringName)
end
function RefreshTable()
end
function CheckAdmin(PlayerName,PlayerID)
end
function Unban(UserId)
end
function Ban(UserId)
end
function CheckStatus(UserId)
end
game.Players.PlayerAdded:connect(function(Player)
if (CheckStatus(Player)) == true and DisableKickOnJoin == false then
Player:Kick(KickMessage)
end
if Player.UserId == game.CreatorId or CheckStatus(Player.Name,Player.UserId) then
print(Player.Name.." Has Joined And Has Admin Access")
Player.Chatted:connect(function(Msg)
end)
while true do
end
return module

2 comments
I didn't check the scripts fully, but from what you're saying, it's not possible unless you use global variables.
You're in one of those situations where you have to call functions from the server script and do all the variable checks in the server script to make sure the players is banned or is an admin. If you were holding all the variables in the module script then referencing those variables in the server script would then work.