if I have a module script that contains a RemoteEvent, and I require it 3 times somewhere on the client will the RemoteEvent be called 3 times, or will I just do it once?
Example:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remoteEvent = ReplicatedStorage:FindFirstChildOfClass("RemoteEvent")
local Module = {}
function Module.onEvent(param)
print(param)
end
remoteEvent.OnClientEvent:Connect(Module.onEvent)
return Module
I used it for getting from server.
Like Datastore sends stats: strength, agility, health through FireClient. And he gets it from OnClientEvent. And module script is safer. After requiring module script u can destroy it. And exploiter can’t use code from module script, only thing he can is to call a function. But in the way I use it even if he calls a function it will just change the gui textlabels to server values
Edit: I got a thought. Like if changes localscript he need to reload script, but if he reloads, it requires a module script that was destroyed, so he got error and ruined his own game experience all by himself
The remote event will be called as many times as the line that is calling it is executed. If the line that is calling it is executed 10 times, then it will be called 10 times.