I have a table of enemies with the enemy’s character as the key, and the enemy table as the value, and I’m requesting this table on join through a remote function
Server
enemyRequestRF.OnServerInvoke = function(rbxPlayer)
local configs = {}
for character, enemy in pairs(EntityList:GetEnemies()) do
print("SERVER", character, enemy.Config)
configs[character] = enemy.Config
end
return configs
end
Client
local configs = enemyRequestRF:InvokeServer()
for character, enemyConfig in pairs(configs) do
print("Client", character, enemyConfig)
end
If I pass the character itself as the value it replicates properly, but when the key is a instance it will replicate as a string rather than as a instance
I already know a workaround for this, but I don’t know why this is happening
Is this a bug, or is it intended behavior?