Im making a dance gui like ttd 3 game so im trying to play sound when i click the button to make the animation and sound fit. Also i have more buttons so when i click another button it should stop the sound
i really need the script.
Thank You!
Im making a dance gui like ttd 3 game so im trying to play sound when i click the button to make the animation and sound fit. Also i have more buttons so when i click another button it should stop the sound
i really need the script.
Thank You!
Where you put Song:play()
should be Song:Play()
Roblox is case sensitive in scripting sometimes. ¯_(ツ)_/¯
Thing is, play()
would be deprecated so it wouldn’t make any difference
The main issue is that MouseClick
is an Event for ClickDetectors
If you want to detect GuiObjects when they get clicked, you’ll have to refer to the MouseButton1Down
Event:
local Button = script.Parent
local Song = Button.Sound
Button.MouseButton1Down:Connect(function()
Song:Play() --Is the same as doing Song:play(), just that it's not recommended to do that
end)
Will the song stop after pressing another button and play another song?
I still want to know that it stops when I change the song
No it won’t stop the old one and play the new one, it will play both at the same time because you never told the old sound to stop playing.
Can I do it like dance GUI when pressing another button the old one will stop?
Like this