Jump to content
Sign in to follow this  
SRBuckey5266

How do you make a script global?

Recommended Posts

"publicThis" addPublicVariableEventHandler {hint ((_this select 0) + " has been updated to: " + str (_this select 1))};
publicVariable "publicThis = 'test';";

I want to run code to all clients in a multiplayer server; however, the above test does not seem to work. Is there any way you can broadcast code to all?

Share this post


Link to post
Share on other sites

try

"publicThis" addPublicVariableEventHandler {hint ((_this select 0) + " has been updated to: " + str (_this select 1))};

publicThis = 'test';

publicVariable "publicThis";

Share this post


Link to post
Share on other sites

Sadly that did not work. :/

I'm not sure why this is. This is what the addPublicVariableEventHandler function is suppose to do, correct?

Share this post


Link to post
Share on other sites

There is no reason for it not to work. Make sure that this line of code exists on every client

"publicThis" addPublicVariableEventHandler {hint ((_this select 0) + " has been updated to: " + str (_this select 1))};

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×