Can somebody please explain to me what is a module script and can you please explain this script aswell because this script is also a module script?

Hello there,

I wonder if you can please explain what is a module script and also, can you please explain this script aswell? Thank you.

Important Information: Can you please try to explain this script the most easiest way because I don’t know how to script but, I might be able to modify some code and I might be able to understand some code.

-- services

-- module

local MOUSE	= {
	ScreenPosition	= Vector2.new();
	WorldPosition	= Vector3.new();
	Reticle			= "Default"
}

return MOUSE

Module scrips are like tables, you can save data/function in the table and access them through normal script. They help to keep the scrips organized.
coming to this script

local MOUSE	= {
	ScreenPosition	= Vector2.new();
	WorldPosition	= Vector3.new();
	Reticle			= "Default"
}
return MOUSE

Mouse is a module, you can access members/variables of mouse from a normal script.
you should use require() to access the module script
Ex

local ModuleScript = --path of module script
ModuleScript = require(ModuleScript)
print(ModuleScript.ScreenPosition, ModuleScript.WorldPosition, ModuleScript.Reticle)

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