--[[
[Client] : Call play function, firing the Arguments to the server
-> [Server] : Fire all client the Arguments
-> [Client] : Run the module's effect function
Arguments = {
["Module"] : ModuleScript - A module that return the function
for the effects
["Info"] : {} - A list contain of informations that
the function might need : function executer, ect
}
]]
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local EffectRemoteEvent = ReplicatedStorage.Events.RemoteEvent.Effects
if RunService:IsServer() then
EffectRemoteEvent.OnServerEvent:Connect(function(args)
EffectRemoteEvent:FireAllClients(args)
end)
else
EffectRemoteEvent.OnClientEvent:Connect(function(args)
require(args["Module"])(args["Info"])
end)
end
local SyncEffect = {}
function SyncEffect.Play(Arguments : {["Module"] : ModuleScript, ["Info"] : {}})
EffectRemoteEvent:FireServer(Arguments)
end
return SyncEffect
I made this module for my game for simply syncing the effects. can you guys point out the flaws and help me improve it?

** You are now Level 1! **