Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Table through a remote event?

Asked by 7 years ago

Is it possible to send a table through a remote event and how do you send it?

0
yes, RemoteEvent:FireServer({1,2,3,4}), RemoteEvent.OnServerEvent:Connect(function(Player, Table) --ect end) abnotaddable 920 — 7y
0
Yes it's possible. I've done it before :P it's like sending regular arguments just its a table. ExampleEvent:FireServer({1,2,3,4,5}), ExampleEvent:FireAllClients({1,2,3}), ExampleEvent:FireClient(plrObj,{1,2,3,4,5}) NodaDuck45 15 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago

I do it all the time and it's a wonderful way to write your RemoteEvents functions. Example:

--//Client side
REvent:FireServer("Example", {1, 2, 3, 4, 5})


--// Server side
REvent.OnServerEvent:Connect(function(player, request, data) 
    if request == "Example" then
        for i, v in pairs (data) do
            print(v)
        end
    end
end
Ad

Answer this question