Do you get any error message from lua that function is expected but nil?
If yes your lua control SetLocator.UI.Window.Close might not be a button, but something else, and thus does not provide SetClickSound.
I guess your problem is that you try to assign the button template ZO_ButtonBehaviorClickSound as sound:
https://github.com/esoui/esoui/blob/...mplates.xml#L3
It's just a virtual XML template that you are able to use via e.g. WINDOW_MANAGER:CreateControlFromVirtual specifing this as template name.
It uses the clicksound "click", so this would most likely be SOUNDS.CLICK (or similar).
And it is reused in other button types like ZO_DefaultButton (
https://github.com/esoui/esoui/blob/...mplates.xml#L5) -> inherits="ZO_ButtonBehaviorClickSound".
So this is not a sound name, but a defined control with some XML attributes.
Try SetLocator.UI.Window.Close:SetClickedSound(SOUNDS.DIALOG_ACCEPT) or any other SOUNDS.<name> which you are able to find here
https://wiki.esoui.com/Sounds (some are silent! So try them ingame via /script PlaySound(SOUNDS.<SOUNDNAME>) to hear if you hear anything.
Does this work and play the sound?
Or try the addon merTorchbug fixed and improved. It provides a list of all sounds ingame if you type /tbug, navigate to the "Sounds" tab. You can click them to play them. It also provides inspectors to check your addon's global variables and functions, and get information abou controls below the cursor using a keybinding, slash command /tbm or pressing right+left mouse+SHIFT key
If you do not want to set the click sound manually, but want your button to reuse/inherit from the ZO_ButtonBehaviorClickSound button template, you need to create your lua button control using this function here
https://github.com/esoui/esoui/blob/...alvars.lua#L17 and specifying the "ZO_ButtonBehaviorClickSound" as templateName.
Or this function here
https://github.com/esoui/esoui/blob/...alvars.lua#L21 to apply the template after creation of your control without a template.
One info: You do ne need to end lines with ; , but you can afaik.