Skemech Posted October 26, 2023 I'm trying to use acs to make a door that you can toggle on and off seperately... wtf am I doing wrong? 0 Share this post Link to post
0 Skemech Posted October 26, 2023 The "kys" is a placeholder, I just needed to put something fast so I could test the door... the door wasn't a success 0 Share this post Link to post
0 DynamiteKaitorn Posted October 26, 2023 Has been a while since I've handled ACS but erm... "script 1 (int kys)" is that trying to define kys as an integer? 0 Share this post Link to post
1 SirPootis Posted October 26, 2023 (edited) You'll want to use a 'void' script, since your bool variable is initialized globally. You can also use 'if / else' logic instead of two 'ifs' if you're just checking if a bool is true or false. Fixed script (tested this on my end and it works fine): #include "zcommon.acs" bool flag = TRUE; script 1 (void) { if (flag == TRUE) { Door_Open(1, 32, 0); flag = FALSE; } else { Door_Close(1,32,0); flag = TRUE; } } Edited October 26, 2023 by SirPootis 0 Share this post Link to post
0 Skemech Posted October 26, 2023 21 minutes ago, SirPootis said: You'll want to use a 'void' script, since your bool variable is initialized globally. You can also use 'if / else' logic instead of two 'ifs' if you're just checking if a bool is true or false. Fixed script (tested this on my end and it works fine): #include "zcommon.acs" bool flag = TRUE; script 1 (void) { if (flag == TRUE) { Door_Open(1, 32, 0); flag = FALSE; } else { Door_Close(1,32,0); flag = TRUE; } } =========== "ELSE" OMFG "ELSE"?!?!? I can't believe I didn't think about it, thank you a million, it worked bro, god ur a real one for that 0 Share this post Link to post
Question
Skemech
I'm trying to use acs to make a door that you can toggle on and off seperately... wtf am I doing wrong?
Share this post
Link to post
4 answers to this question
Recommended Posts