triggerClientEvent ( [table/element sendTo=getRootElement()], string name, element sourceElement, [arguments...] )
You can't use root in this case use source, or thePlayer element you're using.
triggerClientEvent(source,"onLock",theVehicle)
One more note, the first argument is optional, you can use
triggerClientEvent("onLock",theVehicle,thePlayer)
And that's it, your client event "onLock" will play https://wiki.multitheftauto.com/wiki/PlaySound3D using https://wiki.multitheftauto.com/wiki/GetElementPosition of the vehicle, and the source element is thePlayer or localPlayer.