Suppose I have a code that would return a function from a table whenever a remote function is invoked like this:
Server side:
local function getPlayerStateData(player, _type)
if _type == "States" then return playerStatesData[player.UserId] end
if _type == "Moves" then return playerMovesData[player.UserId] end
end
local playerDatas = {
["States"] = getPlayerStateData
}
game:GetService("ReplicatedStorage).RemoteFunction.OnServerInvoke = function(plr, funcName)
return playerDatas[funcName]
end
Client side:
print(RFHandler:InvokeServer("States"))
My question is, how’d I call that function on the client side? What do I write to make it return the states type?