Roblox Tables Script

Is there any way to transfer a table from a ServerScript to a LocalScript, I would like to transfer the player names from one table in ServerScript to another table in LocalScript

Example

local t4 = {"josa","pepe","mike"}

FormatoLista:FireClient(t4)
				
```

The first parameter is the player and the second parameter is the arguments to pass to the client. You did not specify the player.

1 Like

Of course there is, you just send the fireclient to a specified player with the table and have a local variable table inside the specific local script that you want to contain the table and it’ll update everytime you fire.

How would this be?, I am creating a gui for each player from ServerScript and start generating frames with the information from the table, so each player should have the same information from ServerScript

If you want each client to have the same table you can use the FireAllClients method.

do not copy and paste everything, I did not write the onevent properly

--at top of local script
local NameTable = {}

--later onclientevent
onclientevent:connect(function(TargetTable)
NameTable=TargetTable
end)

consider firing to all clients if you want all players to have same table

this appears when I try to send the table from ServerScript

 Unable to cast value to Object -  Server

can you show how you are firing the array? (show code from the server script)

also wouldnt hurt to see how you are using it in local

Server:
xd1 ![xd2|435x245]
Local
xd2
This has worked for the moment using: FireAllClients, tomorrow I will test it with the players stored in the table

Thanks for your help…

1 Like