triggerLatentClientEvent
Client-side
Server-side
Shared
Needs checking
This function was partially migrated from the old wiki. Please review manually:
- Missing section: triggerClientEvent vs triggerLatentClientEvent test by DreTaX
This page is incomplete! Help wanted!
Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.
This function is the same as triggerClientEvent except the transmission rate of the data contained in the arguments can be limited and other network traffic is not blocked while the data is being transferred.
Note
You should avoid triggering events on the root element unless you really need to. Doing this triggers the event on every element in the element tree , which is potentially very CPU intensive. Use as specific (i.e. low down the tree) element as you can.
Syntax
triggerLatentClientEvent ( )Code Examples
server
addEvent("onClientReadFile",true)addEventHandler("onClientReadFile",root,function(data) local file = fileCreate("text.txt") --Save "data" into "text.txt" fileWrite(file,data) fileClose(file)end)