
steven0320
Joined: Jul 30, 2016
|
Posted: Jul 30, 2016 10:30 PM
Msg. 1 of 3
Hello, I am currently working on a new map, I decided to make a secret room that is underwater, but I also wanted to place a blast door and be able to lock it from inside. Since I want it to be unlocked at first and then lock it using a switch, I would need to make a script that sets power to 0 at the beginning of the game, and then when someone activates the switch to change the power to 1. I have heard that to do this I need to use scripts that lock/unlock the door itself and another script that syncs it between clients and host. I have tried looking for guides, videos, and tried writing the script myself, but still have not being able to make it work. Could someone show me a basic script to change the power of a device using a switch. Thanks.
|

steven0320
Joined: Jul 30, 2016
|
Posted: Jul 31, 2016 03:22 PM
Msg. 3 of 3
Hello, thank you for the link, I tried sargejohnson's script but I dont get the "press e" when I stand infront of the switch, it might be missing the trigger volume. I already added the trigger volume but dont know how to add it to the script. This is the script I'm using. Quote: --- Original message by: sargejohnsonLike this? (script continuous door (if ( = (device_get_power door_control) 1) (device_set_power door_test 1) ) (if ( = (device_get_power door_control) 0) (device_set_power door_test 0) ) )
|