Accessing World vars from a plug-in

Posted by Cwsaylor on Wed 17 Sep 2003 01:47 AM — 2 posts, 11,791 views.

#0
I'm trying to access variables I set in a world from a plugin.

I'm using this bit of code to try to get to the variable but it isn't working.


function drinkWater()
  {
  var cont_drink;
  cont_drink = world.GetVariable("cont_drink");
  world.execute("drink " + cont_drink);
  }


Any idea what's wrong?

Thanks,
Chris
#1
Nevermind. I just found my answer in another forum.

This works.


function drinkWater()
  {
  var cont_drink;
  cont_drink = world.GetPluginVariable ("","cont_drink");
  world.execute("drink " + cont_drink);
  }


Thanks,
Chris