#this music sysem is not working

1 messages · Page 1 of 1 (latest)

stray bramble
#

i wanted a sound system with witch when clicked it chandes the image and start the song i took ai help as im a ui scripter and a modler . the ai telling me to add this script in the image button but it only changes the image does not start the audio pls help

heres the script

local imageButton = script.Parent
local currentImage = 1
local images = {"rbxassetid://14219414360", "rbxassetid://7063694142"} -- Replace with actual image asset IDs
local soundIds = {95340344094014, 95340344094014} -- Replace with actual sound asset IDs
local soundService = game:GetService("SoundService")
local sound = Instance.new("Sound", soundService)

imageButton.MouseButton1Click:Connect(function()
currentImage = currentImage % #images + 1
imageButton.Image = images[currentImage]

-- Stop any currently playing sound
if sound.IsPlaying then
    sound:Stop()
end

-- Set and play the new sound
sound.SoundId = "rbxassetid://95340344094014" .. soundIds[currentImage]
sound:Play()

end)

#

pls help

stray bramble
#

ok

#

@grand plover

#

the pause key is the button

#

can u tell me how to unbug it

stray bramble
#

did u amde it

#

made

#

i want it to turn and off

#

rly!

#

but thats a cool concept change song and pause and start

#

that a good but i have to sleep

ashen knollBOT
#

studio** You are now Level 1! **studio

stray bramble
#

ty