Hi there, does anyone know how I could use the table called "Names" in a print from a remote event? This is what the local script sends. Thanks :)
RemoteEvent:FireServer("ListOfNames", Names)
Hi there, does anyone know how I could use the table called "Names" in a print from a remote event? This is what the local script sends. Thanks :)
RemoteEvent:FireServer("ListOfNames", Names)
you can just literate through the table from the server if that's what your looking for, like this:
--server
RemoteEvent.OnServerEvent:Connect(function(player,ListOfNames,table)
if ListOfNames == "ListOfNames" then
for i,v in pairs(table) do
print(i,v) --prints the index and value of it
end
end
end)
, also you cant directly print a table, so you could just loop over it using a generic for loop
wouldn't using print(unpack(table)) work too??
yes, its your choice. I pefer for loops
you can also use table.concat
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
RemoteEvent.OnServerEvent:Connect(function(plr, Table) print(table.concat(Table, ', ')) end) something like that <--