View Single Post
Old 07-16-2004, 10:21 AM   #1 (permalink)
xApoCx
 
Join Date: Jun 2004
Age: 25
Posts: 56
Default Secret door open switch

Hi all,

I make for us this script. It's switch (default ItemID is switch but can be changed through [props command to everything you want) for opening secret doors.

DESCRIPTION

1. The switch has two different faces (not pressed and pressed)
2. You can make a lot of "copies" of it for opening the same door (doors)
3. One switch can controll one or more doors
4. Automaticly closes door(s) after 5s.

INSTALATION

1. Copy Switch.cs somewhere you want.
2. Replace the BaseDoor.cs and SecretDoors.cs in /items/constructions/doors
or in BaseDoor.cs create new virtual property

public virtual bool CanOpen {get{return true;}}
and use it in Use and OnTelekinesis functions to check for "can open"
if if Use function will be the Mobile from = null then open the door

in SecretDoors.cs override this property to false

USING

Create the "Master" switch by [add switch x y z where x = DoorFacing, y = DoorType (1-6) and z = number of doors to control

by [props change the MakeDoors property to true, this generate the Z doors on the same place like switch. This doors move by [move where you want and change its properties by [props.

If you want to make another switch for the same doors by [props change on the master switch MakeChild to true (it will be the still false, but on the same place as master switch will be created a new one )

Move this new switch by [move and set its properties by [props.

If you [remove the master switch everything will be deleted (all doors and child switches)
Attached Files
File Type: cs Switch.cs (6.7 KB, 84 views)
File Type: cs BaseDoor.cs (14.3 KB, 107 views)
File Type: cs SecretDoors.cs (4.3 KB, 101 views)
xApoCx is offline   Reply With Quote