Since i didn't have a solution to do a server-client data layer in Lua i decided to build one in C++. This is mainly due to being more familiar with multi threading in C++, And this kind of stuff needs to be in a separate thread from the 3D rendering thread, in my opinion. 
But i still wanted to use LUA for prefab scripting and all the other neat stuff Leadwerks. 
  
Here is what i did to make this work: 
  
I installed tolua++ on my development machine with 
  
sudo apt-get install libtolua++5.1-dev 
  
I build a class named ShotListener.h 
  
 
#pragma once
#include "App.h"
#include "Leadwerks.h"
using namespace Leadwerks;
class ShotListener { //tolua_export
private:
public:
//tolua_begin
   ShotListener(void) {
   }											    // constructor 1
   ~ShotListener(void){}											 // destructor
   void shot(Object* oEntity, float damage) {
    App *app = App::getInstance();
    Entity * entity = (Entity*)oEntity;
    app->entityShot(entity, damage);
    return;
   }
   float getHealth(Object* oEntity) {
    App *app = App::getInstance();
    Entity * entity = (Entity*)oEntity;
    float value = app->getEntityHealth(entity);
    return value;
   }
};
 
  
I Made the App class into a Singleton, so that any Lua script can instantiate the ShotListener and call functions from the App. 
I made a tolua++ ShotListener.PCK file to match the ShotListener class: 
  
 
$#include "shot.h"
class ShotListener {
ShotListener();
~ShotListener();
void shot(Object* oEntity, float damage);
float getHealth(Object* oEntity);
};
 
  
In the terminal i used the following command to make the ShotListener.PCK into actual C++ code: 
  
tolua++5.1 -o tolua_shot.cpp -H tolua_shot.h -n ShotListener shotlistener.pkg 
  
This created two files tolua_shot.cpp and tolua_shot.h. 
  
These i included in my project along with the ShotListener.h file. 
  
In the main.cpp i added the following before the app->Start() 
  
 
if (Interpreter::L==NULL) Interpreter::Reset();
tolua_ShotListener_open(Interpreter::L);
 
  
Hi then had a ton of debugging to avoid segmentation error bugs related to multithreading. But in the end it works.