General Description
I experienced some weird issues regarding parameter passing when using TriggerClientEvent in Lua with one of our resources. I’ve been attempting to trigger a client event using almost the exact same parameters in two differing resources but have been experiencing a changed result in the last parameter on only one specific resource, the parameter is being changed from a true value to a nil value only on the last parameter, with all the other parameters being passed as they should be. In the other resource, the TriggerClientEvent is passing all of the correct parameters to the client event handler with no changes to the last parameter.
Not sure what is necessarily going on here and considering my recent introduction into Lua, I didn’t want to report a bug that could be caused by my ignorance.
The TriggerClientEvent call on the resource that is passing all correct parameters:
A print of the parameter received by the Event Handler on the client:
As can be seen, all the parameters are being received correctly by the event handler, with the last parameter being correctly received as true
The TriggerClientEvent call on the resource that is passing the last parameter as nil
A print of the parameters received by the Event Handler on the client:
As can be seen here, the last parameter is being received by the Event Handler as nil even though the TriggerClientEvent is passing a true boolean as its last value. All of the previous parameters are being passed correctly. This switching of the final parameter from a true to nil occurs for all of the TriggerClientEvent calls within this resource
Client Event Handler in Question
Final Note:
I could honestly just be doing something stupid here and someone just needs to let me know what’s up. If anyone needs any more information regarding the issue, I’ll be happy to provide it.