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

How do you pass tables in remote events?

Asked by 4 years ago

Hello. I am new to remote events and I wanted to pass a table value from a local script to a server script. This is what I want to pass:

ClockTime[1]

And this changes every 60 seconds:

ClockTime = {12, 1, 2, 3, 4, 5, 6}

1 answer

Log in to vote
1
Answered by
bnxDJ 57
4 years ago

Heres a quick example.

local

local Table = {"val1","val2"}
local Event = game.Workspace:WaitForChild("PassValueEvent")--Normal remote event

Event:FireServer(Table)

Server

local Event = game.Workspace:WaitForChild("PassValueEvent")

Event.OnServerEvent:Connect(function(playerThatFired,Table)
--First value will always be the player that fired the event.
print(playerThatFired," fired the event and sent ",#Table," things in a table.")
end) 

Ad

Answer this question