I have a elevator tag from b40 and I was wondering how I make it move up, with the press of a button, and move down with the press of a button once its up, and how to make it have buttons, and how to make it go a certain height. Like RPG_Beta6's evelvator, that height and those buttons. Thanks if you can help.
EDIT: Can somebody write this script so it works and doesnt have errors:
(global bool server false)
(global bool up false)
(global bool down true)
(script startup i_like_apples
(begin
(unit_suspended up_sync true)
(unit_suspended moving_up_sync true)
(unit_suspended moving_down_sync true)
(unit_suspended down_sync true)
(if
(>=
(unit_get_health host_check) 0.00)
(set server true))))
(script continuous server_side
(begin
(if
(= server true)
(begin
(if
(and
(or
(>
(device_get_position up_switch) 0.00)
(>
(device_get_position down_switch) 0.00))
(= down true))
(begin
(set down false)
(device_set_position_immediate up_switch 0.00)
(device_set_position_immediate down_switch 0.00)
(device_set_power up_switch 0.00)
(device_set_power down_switch 0.00)
(object_destroy down_hog)
(object_create_anew down_sync)
(unit_suspended down_sync true)
(object_create_anew moving_up_hog)
(sleep_until
(<=
(unit_get_health moving_up_sync) 0.00) 1)
(device_set_position elevator 1.00)
(sleep_until
(>=
(device_get_position elevator) 1.00) 1)
(object_destroy moving_up_hog)
(object_create_anew moving_up_sync)
(unit_suspended moving_up_sync true)
(device_set_power up_switch 1.00)
(device_set_power down_switch 1.00)
(set up true)
(object_create_anew up_hog)))
(if
(and
(or
(>
(device_get_position up_switch) 0.00)
(>
(device_get_position down_switch) 0.00))
(= up true))
(begin
(set up false)
(device_set_position_immediate up_switch 0.00)
(device_set_position_immediate down_switch 0.00)
(device_set_power up_switch 0.00)
(device_set_power down_switch 0.00)
(object_destroy up_hog)
(object_create_anew up_sync)
(unit_suspended up_sync true)
(object_create_anew moving_down_hog)
(sleep_until
(<=
(unit_get_health moving_down_sync) 0.00) 1)
(device_set_position elevator 0.00)
(sleep_until
(<=
(device_get_position elevator) 0.00) 1)
(object_destroy moving_down_hog)
(object_create_anew moving_down_sync)
(unit_suspended moving_down_sync true)
(device_set_power up_switch 1.00)
(device_set_power down_switch 1.00)
(set down true)
(object_create_anew down_hog))))
(sleep_until
(= 0.00 1.00)))))
(script continuous client_side_position
(begin
(if
(= server false)
(begin
(if
(<=
(unit_get_health up_sync) 0.00)
(device_set_position_immediate elevator 1.00))
(if
(<=
(unit_get_health down_sync) 0.00)
(device_set_position_immediate elevator 0.00)))
(sleep_until
(= 0.00 1.00)))))
(script continuous client_side_movement
(begin
(if
(= server false)
(begin
(if
(<=
(unit_get_health moving_up_sync) 0.00)
(begin
(device_set_position up_switch 1.00)
(device_set_position down_switch 1.00)
(device_set_power up_switch 0.00)
(device_set_power down_switch 0.00)
(object_create_anew down_sync)
(unit_suspended down_sync true)
(device_set_position elevator 1.00)
(sleep_until
(>=
(device_get_position elevator) 1.00) 1)
(object_create_anew moving_up_sync)
(unit_suspended moving_up_sync true)
(device_set_power up_switch 1.00)
(device_set_power down_switch 1.00)
(device_set_position_immediate up_switch 0.00)
(device_set_position_immediate down_switch 0.00)))
(if
(<=
(unit_get_health moving_down_sync) 0.00)
(begin
(device_set_position up_switch 1.00)
(device_set_position down_switch 1.00)
(device_set_power up_switch 0.00)
(device_set_power down_switch 0.00)
(object_create_anew up_sync)
(unit_suspended up_sync true)
(device_set_position elevator 0.00)
(sleep_until
(<=
(device_get_position elevator) 0.00) 1)
(object_create_anew moving_down_sync)
(unit_suspended moving_down_sync true)
(device_set_power up_switch 1.00)
(device_set_power down_switch 1.00)
(device_set_position_immediate up_switch 0.00)
(device_set_position_immediate down_switch 0.00))))
(sleep_until
(= 0.00 1.00)))))
Edited by tylerp14 on Apr 29, 2011 at 08:11 PM