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)
)
)
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.