elevater script

please keep scripting in here only

Moderators: Q-dad~TAG, EXP STAFF, Moderator

elevater script

Postby loa » 01-06-2007 01:10 PM

this comes from my map in mohaa called loa_embasy.. its a script for a working elevater.. elevater triger help thanks to da_crapper



// SCRIPTING:LoA
//Elevater by Da_Crapper



main:

// set scoreboard messages

$world farplane 5000
$world farplane_color ( 0.10 0.05 0.05)

level waittill prespawn

//*** Precache Dm Stuff
exec global/DMprecache.scr
exec global/ambient.scr elevator_test
exec global/door_locked.scr
level.script = "maps/dm/LoA_embasy.scr"

level waittill spawn

thread elevator_preparation //Set the threads...

thread elevator_reset

end

//----------------------------------------------------------->
// Prepares the elevator by assigning the basic settings to it
//----------------------------------------------------------->

elevator_preparation:

$elevator_switch bind $elevator
$elevator_button bind $elevator
$elevator_light bind $elevator
$elevator_bulb bind $elevator

$elevator time 4 // sets the elevator move time, 4 seconds in this case, could also use the command "speed".
local.elepos = 1 // Defines the position of the elevator. "0 - lift down" "1 - lift up" Default - lift down

elevator_reset:
thread elevator_standby
thread elevator_up
thread elevator_down

elevator_standby:
$elevator_switch waittill trigger
{
$elevator_switch playsound door_metal_locked_clue
println "111"
wait 2
if (local.elepos == 0)
{
println "elevator down - moving up"
goto lift_move_up
}
else
if (local.elepos == 1)
{
println "elevator up - moving down"
goto lift_move_down
}
}

elevator_up:
$elevator_switch_up waittill trigger
{
println "222"
$elevator_switch_up playsound door_metal_locked_clue
goto lift_move_up
}

elevator_down:
$elevator_switch_down waittill trigger
{
println "333"
$elevator_switch_down playsound door_metal_locked_clue
goto lift_move_down
}

//----------------------------------------------------------->

lift_move_up:
{
$elevator playsound elevator_start
$elevator moveto $waypoint_up //moves the lift to info_waypoint with targetname waypoint_up
$elevator playsound elevator_run //plays the "sound/mechanics/Mec_ElevatorRun_01.wav" defined in the ubersound.scr line 1052
$elevator waitmove //wait till the elevator has completed the move before doing anything else
$elevator playsound elevator_stop
local.elepos = 1
goto elevator_reset
}
//----------------------------------------------------------->

lift_move_down:
{
$elevator playsound elevator_start
$elevator moveto $waypoint_down //moves the lift to info_waypoint with targetname waypoint_down
$elevator playsound elevator_run //plays the "sound/mechanics/Mec_ElevatorRun_01.wav" defined in the ubersound.scr line 1052
$elevator waitmove //wait till the elevator has completed the move before doing anything else
$elevator playsound elevator_stop
local.elepos = 0
goto elevator_reset
}
end

//-----------------------------------------------------------
User avatar
loa
Administrator
 
Posts: 1133
Joined: 03-06-2004 01:54 PM

Return to Scripting

Who is online

Users browsing this forum: No registered users and 1 guest

cron