QueryResult
An iterable object returned as the result of Route:query that can filter snapshots by Identifier and Senders.
NOTE
Due to certain limitations with the Luau Type System, iterating over the QueryResult Object
will not return typed values. In order to fix this, call :__iter()
on the QueryResult Object.
For example:
for i, sender, ... in net:query():__iter() do
-- Do something
end
See Querying Data for more information.
Functions
iterating over QueryResult
Iterating over a QueryResult will return the Packets in the QueryResult's Snapshot that match the supplied Senders from QueryResult:from.
Usage:
for pos, sender, ... in net:query():from(...senders) do
-- Do something
end
iter
QueryResult:
iter
(
) →
(
)
An iterator method for typechecking.
for i, sender, ... in route:query():iter() do
-- ...
end
from
Filters Packets from the QueryResult's Snapshot based on the provided Senders.
client
QueryResult:
client
(
) →
(
)
Switches the query to a client view, for typechecking.
The client view will not return a sender
when iterating.
for i, ... in route:query():client():iter() do
-- ...
end
server
QueryResult:
server
(
) →
(
)
Switches the query to a server view, for typechecking.
for i, player, ... in route:query():server():iter() do
-- ...
end