a way this can be used is for effects, some effects have different settings that need to be changed, for example, smoke can be changed by using lifetime or color, but a mesh effect can be changed by using size or position
You can fire a remote with whatever arguments you want. What really matters is how your scripts process those arguments. If you have different arguments, your processing scripts will have to be able to tell the difference between the arguments. Typically I would just add more arguments to the fire function and set the arguments I don’t need to nil.
You can use if statements to check what type of string, or what datatype, is being passed in the first parameter.
RemoteEvent.OnSererverEvent:Connect(function(player, effectName, arg1, arg2)
if effectName == "Smoke" then
-- Do something with Smoke
elseif effectName == "Mesh" then
-- Do something with Mesh
-- And so on, and so on
end
end)
Tables
Another way to do this, if you are solely modifying the Properties of an Instance, is by utilizing tables.
-- Server
RemoteEvent.OnServerEvent:Connect(function(player, effectType, effectProperties)
local effect; -- Do something so you could get the expected effect
for key, value in pairs(effectProperties) do
effectProperties[key] = value
end
--- Further, modify the effect (handle cleanup and show the effect)
end)
-- Client
RemoteEvent:FireServer("Smoke", {
Color = Color3.new(1, 0, 0),
Size = 5
})
RemoteEvent:FireServer("Mesh", {
CanCollide = false,
Color = Color3.new(0, 1, 0),
Position = Vector3.new(10, 4, 10)
})