So recently, my dictionary that I’m sending over with a remote function from: (call) local → (calculate) server → (send back) local
converts my vector2 into strings
So for example, a table like this
local myTable = {
[vector2.new(-1,1)] = 0
}
--[[ When printing it looks something like this below
because that's how it displays in the console normally ]]
[Vector2(18D6C1A3040)] = 0,
would be converted into this
["<Vector2> (-1, 1)"] = 0,
which isn’t even like the tostring(vector) version which would return “-1, 1” instead of whatever’s above
I am not sure if this is intentional or a bug, so I’m just going to go ahead and report it just in case
thats intentional “bug” same thing happens when you store Instances as index inside of table
example code that proves this theory:
game:GetService("Players").PlayerAdded:Wait()
local Players=game:GetService("Players"):GetPlayers()
local players1={[Players[1]]="test"}
print(players1)
local button = script.Parent.t -- Button to just activate local
local rmf = game.Workspace.scriptTest.RemoteFunction -- Remote Function
button.MouseButton1Down:Connect(function()
local r = rmf:InvokeServer()
for n, v in pairs(r) do
print(n,v,type(n))
end
end)
If any indices of a passed table are non-string types such as an Instance, userdata, or function, Roblox automatically converts those indices to strings.