Hi,
The Title says it all,
I am wondering if its a bad thing to have a ModuleScript
do a lot of work for the Game like Hold Services, Store all Tables, Data, etc
Example from two of my Scripts:
local server = {}
server.CollectionService = game:GetService("CollectionService")
server.Players = game:GetService("Players")
server.AlivePlayers = {}
server.MapWorkspace = workspace:WaitForChild("Map")
server.MobFolder = workspace:WaitForChild("MobFolder")
function server:Intermission(Time: number, Speed: number)
for i = Time,0,-1 do
task.wait(Speed)
print(i)
end
end
function server:ClearMobs()
for number, mob in pairs(workspace:WaitForChild("MobFolder"):GetChildren()) do
server.CollectionService:RemoveTag(mob, "mob")
end
return server.MobFolder:ClearAllChildren()
end
function server:InsertPlayers()
for _,plr in pairs(server.Players:GetPlayers()) do
table.insert(server.AlivePlayers, plr)
plr.Character:WaitForChild("Humanoid").Died:Connect(function()
if table.find(server.AlivePlayers, plr) then
print(plr.DisplayName.." had Died")
table.remove(server.AlivePlayers, plr)
print(server.AlivePlayers)
end
end)
end
return print(server.AlivePlayers)
end
return server
----------------------------------------------------------------------------------------------
Server = require(game.ReplicatedStorage.Lib.Server)
Data = require(game.ReplicatedStorage.Lib.Server.DataStore)
----------------------------------------------------------------------------------------------
Server.Players.PlayerAdded:Connect(Data.Get)
Server.Players.PlayerRemoving:Connect(Data.Set)
-- Below are test functions:
Server:Intermission(60, .2)
Server:InsertPlayers()
Is this a bad thing or a normal thing?
Just a Question
Thanks.