#Music
1 messages · Page 1 of 1 (latest)
Don't wrap another MouseButton1Click inside a MouseButton1Click
Make a bool variable that flips on and off every time the user clicks the button
Then check if the variable is false, play the audio
And vice versa
I'm new to scripting, can you tell me where to write this?
pls
Inside ur script 💀
If u don't know how this works then u should be learning the basics
Make it a seperate function, you can place it underneath since it will work the same
Since they are both connections they dont need to be nested
This is the basics
Ik but he is asking the most obvious question
He needs direction
So direct him accordingly
Otherwise ur just insulting them just to insult them
And that accomplishes nothing lmao
I am just telling him if he didn't understand what that guy said then he should go learn what a boolean is
It seems like he understands what a boolean is from his script
His issue is in callbacks and connections
Rereading just realized that
Not needed
I mean like move the connection to make it not nested
Just anywhere outside the other function
Because that's his main problem
Just make a boolean value I would name it MusicOn and check if it is equals false then make it play and make the book value equals true but else if it is equals true then make it stop and make that boolean value to false.
Then it would play it and stoo it at the same time
OH
Lol
Ohhhh it is two diff buttons
Mb
3 s1 gang
xD
💀
But yeah do a seperate function and the better logical stuff can come later
@orchid osprey
Yeah would help with the nesting too
Well he needs like 0 nesting really
Because if ur establishing a callback when one button is clicked then it is gonna do something funky
it doesn't play since roblox doesn't like phonk
like this idk
Yea
I have to wait again
do you know how to fix it?
That change should fix it
But it would be smart to try to minimize rewritten code and maybe adding a debounce
oh