Is it bad to have a Game Heavily reliant on ModuleScripts?

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.

Module scripts are just like normal scripts, however, you can use the function in every script without typing them out individually.
This helps fixing bugs more easily, since you only need to edit 1 script.

But exploiters can also view Modulescripts, so store Modulescripts with important server side function in ServerScriptService or ServerStorage, this can people from making an exact copy of your game since Modulescripts can be decompiled unlike ServerScripts

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.