View Single Post
  #6  
Old 06-04-2007, 06:38 PM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
You also should make the setValue() function public in order for other npcs to be able to call it.

EDIT:

Here is probably what you are looking for:


NPC 1


PHP Code:
function onCreated() {
  
core this;
}

public function 
setValue(oldValnewVal)
(@ 
oldVal) = newVal
NPC 2

PHP Code:
function onCreated() {
  
this.on true;
  
core.setValue("this.on", (this.on = !this.on));
  echo(
this.on);

I know I changed it quiet a bit but it is sort of hard to see exactly what you want, sorry.

SECOND EDIT:

On second thought, that won't work either as "this.on" will be using the first NPC as "this" (in essence it would be the same as doing "core.setValue("core.on", (this.on = !this.on));")
__________________
Do it with a DON!
Reply With Quote