here is my script file located in the same file as bsp file (maps/dm)
// Elevator Script
main:
level waittill prespawn
// bind the switches to the elevator
// so it doesnt look weird
$down_switch bind $elevator_cab
$up_switch bind $elevator_cab
// bind triggers to the switches
$down_trigger bind $down_switch
$up_trigger bind $up_switch
// I had it moved up for lighting
$elevator_cab movedown 8
$elevator_cab time 0
$elevator_cab move
// sets the speed to 64 units per second
$elevator_cab speed 64
// starts on floor 1
level.elepos = 1
$elevator_cab2 speed 64
level waittill spawn
thread elevator_prep
end
elevator_prep:
thread movedown
thread moveup
end
movedown:
// waits until the player triggers the trigger
$down_trigger waittill trigger
// if the elevator is on floor 1 then end
// because it cant go down anymore
if (level.elepos == 1)
end
// turns off the triggers
// until the elevator is done moving
$up_trigger nottriggerable
$down_trigger nottriggerable
// sets another variable
local.position = level.elepos
//turns the switch
$down_switch anim turn
// makes some noise
$elevator_cab loopsound lighthouse_run
// says to move to the floor
// below the one that it is on
$elevator_cab moveto $("floor" + (local.position - 1))
$elevator_cab waitmove
$elevator_cab stoploopsound
$down_switch anim idle
// Tells the variable to minus 1 from itself.
// Makes the variable set to the correct floor.
level.elepos--
// turns the triggers back on
$down_trigger triggerable
$up_trigger triggerable
goto elevator_prep
end
moveup:
$up_trigger waittill trigger
// if the elevator is at the top then end
// because it cant go up anymore
if (level.elepos == 2)
end
$down_trigger nottriggerable
$up_trigger nottriggerable
local.position = level.elepos
$up_switch anim turn
$elevator_cab loopsound lighthouse_run
$elevator_cab moveto $("floor" + (local.position + 1))
$elevator_cab waitmove
$elevator_cab stoploopsound
$up_switch anim idle
level.elepos++
$up_trigger triggerable
$down_trigger triggerable
goto elevator_prep
end
Hope This helps mate Thanks
