(03-21-2012, 09:44 PM)Your Computer Wrote: Did you understand this? 'Cause it sounds like you didn't:
(03-21-2012, 04:08 PM)palistov Wrote: Third, lights don't turn on/off based on being 'active' or not. They aren't treated as entities, so you'll need to use the scripts to control them.
Also, use SetEntityConnectionStateChangeCallback not SetEntityPlayerInteractCallback.
Okay I used SetEntityConnectionStateChangeCallback
This is what it looks like
//////////////////////////////////////////////////
void OnStart()
{
SetEntityConnectionStateChangeCallback( "lights", "lights_on");
for(int i=1;i<=6;i++) SetLightVisible("light_"+i, false);
}
//////////////////////////////////////////////////
void lights_on(string &in asEntity)
{
SetLightVisible("light_1", true);
SetLightVisible("light_2", true);
SetLightVisible("light_3", true);
SetLightVisible("light_4", true);
SetLightVisible("light_5", true);
SetLightVisible("light_6", true);
}
void lights_off(string &in asEntity)
{
SetLightVisible("light_1", false);
SetLightVisible("light_2", false);
SetLightVisible("light_3", false);
SetLightVisible("light_4", false);
SetLightVisible("light_5", false);
SetLightVisible("light_6", false);
}
/////////////////////////////////////////////////
I hope thats right...
Well anyways now when i start the game the lights are OFF (which im very happy with

)
BUT interacting with (lights) button , doesn't turn them on

What am I doing wrong ?