Client
local spends = {
["SoulSlotOne"] = {},
["SoulSlotTwo"] = {} ,
["SoulSlotThree"] = {},
}
table.insert(spends.SoulSlotOne, soulTreeCache.SoulSlotOneSpends:GetChildren())
table.insert(spends.SoulSlotTwo, soulTreeCache.SoulSlotTwoSpends:GetChildren())
table.insert(spends.SoulSlotThree, soulTreeCache.SoulSlotThreeSpends:GetChildren())
print("Sending data:", spends)
local responseFromServer = requestSoulTreeEndRemote:InvokeServer(spends)
Server
requestSoulTreeEndRemote.OnServerInvoke = function(player, spends)
print("Received data:", spends)
local responseForClient = SoulTreeClass.checkForSpends(player, spends)
if responseForClient == "Good" then
return "Good"
else
return "Bad"
end
end
Output
21:11:54.489 Sending data: ▼ {
["SoulSlotOne"] = ▼ {
[1] = ▼ {
[1] = Value
}
},
["SoulSlotThree"] = ▼ {
[1] = ▼ {
[1] = Value,
[2] = Value,
[3] = Value
}
},
["SoulSlotTwo"] = ▼ {
[1] = ▼ {
[1] = Value,
[2] = Value
}
}
} - Client - SoulTreeUI:182
21:11:54.505 Received data: ▼ {
["SoulSlotOne"] = ▼ {
[1] = {}
},
["SoulSlotThree"] = ▼ {
[1] = {}
},
["SoulSlotTwo"] = ▼ {
[1] = {}
}
} - Server - SoulTreeClass:269
I am having trouble with the “:GetChildren()” function it seems. On the client it grabs and inserts to the table correctly but when it sends it over to the server, the server just gets blank tables…
if I send “Defined Data” then server gets it no problem.
DefinedDataSendScene
local spends = {
["SoulSlotOne"] = {6, 3 ,6},
["SoulSlotTwo"] = { 7, 8 ,7} ,
["SoulSlotThree"] = {22, 53},
}
-- output
21:17:43.190 Sending data: ▼ {
["SoulSlotOne"] = ▼ {
[1] = 6,
[2] = 3,
[3] = 6
},
["SoulSlotThree"] = ▼ {
[1] = 22,
[2] = 53
},
["SoulSlotTwo"] = ▼ {
[1] = 7,
[2] = 8,
[3] = 7
}
} - Client - SoulTreeUI:182
21:17:43.207 Received data: ▼ {
["SoulSlotOne"] = ▼ {
[1] = 6,
[2] = 3,
[3] = 6
},
["SoulSlotThree"] = ▼ {
[1] = 22,
[2] = 53
},
["SoulSlotTwo"] = ▼ {
[1] = 7,
[2] = 8,
[3] = 7
}
} - Server - SoulTreeClass:269