ClientEvent
Example
client.lua
-- Gets the client listener api.
---@type ClientListenerApi
client_listener_api = exports.nss_gta_libs:getClientListenerApi(GetCurrentResourceName())
-- Register a listener for the event "test" and return the result.
---@param _source number The identifier of the client that fired the event.
---@param times number Example argument.
client_listener_api:addListener('test', function(_source, times)
local result = {}
for _ = 1, times do
table.insert(result, 'Hello from client')
end
print('Client Result', table.unpack(result))
return result
end)server.lua
Last updated
Was this helpful?