if else statement for buttons when clicked?

Hello, im trying to shorten the code so i thought of making same points as single function (for home and guest in basketball) which will add to the respective scores based on the button click. i dont know where i went wrong, any help is much appreciated
13 Replies
Unknown User
Unknown Userβ€’2y ago
Message Not Public
Sign In & Join Server To View
Avinash
Avinashβ€’2y ago
this is what i did. its working. pls let me know if this can be improved @webcat || 🧢🐈
Unknown User
Unknown Userβ€’2y ago
Message Not Public
Sign In & Join Server To View
Avinash
Avinashβ€’2y ago
sorry if the question is basic but how would i do that? im new to coding @webcat || 🧢🐈
Unknown User
Unknown Userβ€’2y ago
Message Not Public
Sign In & Join Server To View
Avinash
Avinashβ€’2y ago
this looks bit complex for me , i googled factory function but i dont know how to implement it
Unknown User
Unknown Userβ€’2y ago
Message Not Public
Sign In & Join Server To View
Avinash
Avinashβ€’2y ago
but there are 6 buttons with diff values, so i have make a loop for button? when a particular button is triggered that corresponding values are passed to the function?
Unknown User
Unknown Userβ€’2y ago
Message Not Public
Sign In & Join Server To View
Avinash
Avinashβ€’2y ago
Yeah i will look into it and keep you posted if it worked or not @webcat || 🧢🐈
Unknown User
Unknown Userβ€’2y ago
Message Not Public
Sign In & Join Server To View
Avinash
Avinashβ€’2y ago
Thanks for helping me out. This looks promising, i will try to implement it to my requirements. Dataset is a js inbuilt fn?
Unknown User
Unknown Userβ€’2y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server