Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make a Button couting variable for my game?

Asked by 5 years ago

So, i've posted a question before and the answers really helped me to learn more about stuff like ModuleScripts and DataStorage, but it didn't help me to solve the real problem. So, i'm doing a game like Dead by daylight, but very, very simple (at least i see it simple xD). As i'm beginner in programming, i knew that it's very hard to think in a big game to start. So, my game is a maze where players need to run for a door and survive the monster. But, to make it a little bit hard (I hope you don't think that's a hard task for me, if you think it is, tell me please) the players need to push four buttons (those are separated in the map) and when the fours buttons are pressed the door opens.

My problem is, for the mechanic of the buttons work, I don't know if its better to use DataStorage, ModuleScripts or another way to store the quantity of buttons left to open the doors. I hope you can help me to know how to do it the best way (please, don't get me wrong, i don't want you to do it for me, but to show me the best way to do a good buttons mechanic).

Thank you guys, i've been working hard in my project even if it is a simple game, and some functions i've already done, but some stuff are just very hard for my beginner skills.

0
maybe try adding a number val that updates with how many buttons pressed then once the value = 4 or however many buttons you need , it'll open the door? im not sure if thats the best way but it'll work... sentry3 6 — 5y
0
Yes, i think this is a good try, but my scripts are separated, like the one that opens the door and the one that counts the buttons left, so i'm searching for the best way to share this variable between separated scripts Mathzs02 14 — 5y
0
Maybe i could put it together but i dont think the buttons would work without a local script... Mathzs02 14 — 5y

Answer this question