Hello try change name of the button because if your button name “sound” the script exucution will have some probelm the script don’t know you mean the sound effect or button named sound.
It’s this line that’s causing the problem, which is the reason you are getting the error.
You are saying that the Sound you are trying to access is parented to the “a” ImageButton when it is actually a child of the TextButton.
Change that line to this:
local Sound = script.Parent:WaitForChild("Sound")
script.Parent.MouseButton1Click:Connect(function()
Sound:Play()
end)
or maybe just put check if the game isloaded if not wait for it
something like this :
if not game:IsLoaded() then game.Loaded:Wait() end
local Sound = script.Parent.Sound
script.Parent.MouseButton1Click:Connect(function()
Sound:Play()
end)