Sign In Register

How can we help you today?

Start a new topic

Accessing var inside a RT script from RT module

Hello I am doing a 1 vs 1 game. I use the real time services. I have my real time script working. But I have an issue with the real time modules. I want the module to be able to access a var from the rt script and modify it. 

for example  

//RT script
var foo;
var mod = require("module");

//RT module

module.exports.RandomFoo = function(){
foo = 1;

 I wonder if there is a way do this without passing the var as parameter and then return it again.

Otherwise I want to know what is the best way to acomplish this. (Like store the data in a datatype, or something)


Login to post a comment