Can you pass a function as a tuple argument when you fire a remote event from the server to the client?

Can you pass a function as a tuple argument when you fire a remote event from the server to the client? The first piece of code is on the client and the second is on the server. The error is “attempt to call a nil value”.

requestAction.OnClientEvent:Connect(function(action)
	print(action == nil) --prints true
	action() --this line errors
end)

local saturationChange = function()
print("gak")
local colorCorrection = game.Lighting.ColorCorrection
print("glook")
colorCorrection.Saturation = -2
print("glimp")
wait(0.5)
print("dj")
colorCorrection.Saturation = 0
print("jd")
end
requestAction:FireClient(player, saturationChange)

no you can only pass JSON valid values over the network, you can’t pass functions.

To solve your current issue, you can pass a Configuration Dictionary instead.

2 Likes

Okay. Thanks a lot for your assistance.

What is a configuration dictionary? I know that dictionaries are tables but I’ve never heard of configuration dictionaries.