(function() { var _this; var TestEntity = function() { _this = this; }; TestEntity.prototype = { remotelyCallable: ['mousePressed'], preload: function(entityID) { _this.entityID = entityID; }, mousePressed: function(entityID, event) { print("Server script has received a mouse press: ", JSON.stringify(event)); } }; return new TestEntity(); });