a more dificult one but might be interesting.
in replicated storage i have a modulescript with the following script
local module = {}
function module.function1 (var1,var2)
--some action
end
function module.function2 (var3, var4)
--some action
end
...
...
...
function module.function99 (var234, var123)
--some action
end
I want this module to be both available to clientside and serverside.
so I was thinking of sending everything through a remote event
local RemoteEvent = script.Parent
local RunService = game:GetService("RunService")
if RunService:IsServer() == true then
RemoteEvent.OnServerEvent:Connect(function(player,func,...)
module[func](...)
end)
end
here is my dilemma…
i can add a
if RunService:IsClient() == true then end
to every function… but there has to be a better way… i do want to keep the function names and variable names with the type checking