however if u call the lift to another then block the doors the triggers arent triggerable anymore n nothing works, i cant figure out why
ill post the entire script
Code: Select all
level waittill prespawn
exec global/DMprecache.scr
exec global/ambient.scr lift
level.script = "maps/dm/lift.scr"
$inner_trigger_1 bind $lift
$inner_trigger_2 bind $lift
$inner_trigger_3 bind $lift
$inner_trigger_4 bind $lift
$inner_door bind $lift
$inner_door_open bind $lift
$inner_door_closed bind $lift
$doors_1 time 2
$doors_2 time 2
$doors_3 time 2
$doors_4 time 2
$inner_door time 2
$lift_up hide
$lift_down hide
level.doorsmoving = 0
level.doorblocked = 0
level.doorpos = 0
level.pos = 1
$lift speed 116 // sets the lifts speed (Units Per Second)
thread indicator_mover
level waittill spawn
end
//------//
// Lift //
//------//
call:
//--------------//
// Triggers Off //
//--------------//
if ((level.doorblocked == 0) || (level.doorsmoving == 0))
{
$inner_trigger_1 nottriggerable // turns off the triggers
$inner_trigger_2 nottriggerable
$inner_trigger_3 nottriggerable
$inner_trigger_4 nottriggerable
$outer_triggers nottriggerable
//---------------//
// Moves Buttons //
//---------------//
$call_buttons playsound click
$call_buttons moveNorth 1 // moves buttons
$call_buttons move
wait .2
$call_buttons moveSouth 1
$call_buttons move
//-------------//
// Close Doors //
//-------------//
if (level.doorpos == 1)
{
if (level.pos == self.floor)
{
}
else
{
$("doors_" + level.pos) doclose
level.doorsclosing = 1
if (level.doorsmoving != 1) // SOUND FIX!
{
$("doors_" + level.pos) playsound lift_gate
}
level.doorsmoving = 1
$inner_door moveEast (vector_length ($inner_door.origin - $inner_door_closed.origin))
$inner_door waitmove
level.doorpos = 0
level.doorsmoving = 0
level.doorsclosing = 0
}
}
}
//---------------------//
// Up and Down display //
//---------------------//
if(self.floor > level.pos) // if called floor is higher than current lift position
{
$lift_up show
level.posa = 1
}
if(self.floor < level.pos)
{
$lift_down show
level.posa = 0
}
//------------//
// Moves Lift //
//------------//
if (level.doorpos == 0)
{
$lift moveto $("floor_" + self.floor)
$lift loopsound lift_sound
$lift waitmove // moves the lift to that destination
$lift loopsound lift_sound wait
level.pos = self.floor
//------------//
// Open Doors //
//------------//
$("doors_" + self.floor) doopen
if (level.doorsmoving != 1)
{
$("doors_" + self.floor) playsound lift_gate
}
level.doorsmoving = 1
$inner_door moveWest (vector_length ($inner_door.origin - $inner_door_open.origin))
$inner_door waitmove
level.doorpos = 1
level.doorsmoving = 0
}
//--------------------------//
// Up and Down display Hide //
//--------------------------//
if(level.posa == 1) // if up button is showing, hide it
{
$lift_up hide
}
if(level.posa == 0)
{
$lift_down hide
}
//-------------//
// Triggers on //
//-------------//
$inner_trigger_1 triggerable // turns triggers on
$inner_trigger_2 triggerable
$inner_trigger_3 triggerable
$inner_trigger_4 triggerable
$outer_triggers triggerable
//--------------------------------//
// Close Doors if lift not in use //
//--------------------------------//
if ((local.waittime == 0) || (local.waittime == NIL))
{
local.waittime = 3
while ((level.doorpos == 1) && (level.doorsmoving == 0))
{
if (local.waittime > 0)
{
local.waittime --
if (level.doorblocked == 1)
{
local.waittime = 3
}
wait 1
}
else
{
$("doors_" + self.floor) doclose
level.doorsclosing = 1
if (level.doorsmoving != 1)
{
$("doors_" + self.floor) playsound lift_gate
}
level.doorsmoving = 1
$inner_door moveEast (vector_length ($inner_door.origin - $inner_door_closed.origin))
$inner_door waitmove
level.doorpos = 0
level.doorsmoving = 0
level.doorsclosing = 0
local.waittime = 3
end
}
}
}
end
//---------------//
// Door Blocked? //
//---------------//
door_blocked:
local.player = parm.other
if (level.doorsclosing == 1)
{
$("doors_" + level.pos) doopen
if (level.doorsmoving != 1)
{
$("doors_" + self.floor) playsound lift_gate
}
level.doorsmoving = 1
$inner_door moveWest (vector_length ($inner_door.origin - $inner_door_closed.origin))
$inner_door waitmove
level.doorpos = 0
level.doorsmoving = 0
}
while (local.player istouching $door_block)
{
level.doorblocked = 1
wait .01
}
level.doorblocked = 0
end
//------------------------------//
// Shows which floor lift is on //
//------------------------------//
indicator_mover:
while (1)
{
if((vector_length ($lift.origin - $floor_1.origin)) < 5)
{
$pos_1 show
$pos_2 hide
$pos_3 hide
$pos_4 hide
}
if((vector_length ($lift.origin - $floor_2.origin)) < 5)
{
$pos_2 show
$pos_1 hide
$pos_3 hide
$pos_4 hide
}
if((vector_length ($lift.origin - $floor_3.origin)) < 5)
{
$pos_3 show
$pos_1 hide
$pos_2 hide
$pos_4 hide
}
if((vector_length ($lift.origin - $floor_4.origin)) < 5)
{
$pos_4 show
$pos_1 hide
$pos_2 hide
$pos_3 hide
}
wait .01
}
end
