Operating a switch [SOLVED]

Started by En garde!, Wed 13/04/2005 02:10:27

Previous topic - Next topic

En garde!

Okay, here's the thing: I have a room with a hotspot, you press it once and an object appears. What I need is to make the object disappear once you press the same hotspot again. Basically I need an on/off switch. Easy, isn't it? Well, no. I think I've tried everything and nothing. Can somebody tell me an easy way? As usual, asume that you are talking with an idiot without the slightest idea of programming.

strazer

Code: ags

// script for hotspot: Interact with hotspot

  if (IsObjectOn(THEOBJECTNUMBER)) ObjectOff(THEOBJECTNUMBER);
  else ObjectOn(THEOBJECTNUMBER);

En garde!

Ha! It worked! Well, if I'm going to make stoopid newbie questions, I may as well go along with it.

Um... a way to make the same making the object on and off AND a different spot being enabled and disabled with it?

strazer

Code: ags

// script for hotspot: Interact with hotspot

  if (IsObjectOn(THEOBJECTNUMBER)) {
    ObjectOff(THEOBJECTNUMBER);
    DisableHotspot(THEHOTSPOTNUMBER);
  }
  else {
    ObjectOn(THEOBJECTNUMBER);
    EnableHotspot(THEHOTSPOTNUMBER);
  }

En garde!

Thanks a bunch. I owe you one.

strazer


SMF spam blocked by CleanTalk