I was trying to make an audio play when the player would press a button but I get an error saying "PlayLocalSound Is Not A Valid Member Of Sound." And im not sure how to fix this error. Here is the code
sound = script.Parent
function onKeyPress(inputObject, gameProcessedEvent)
if inputObject.KeyCode == Enum.KeyCode.Q then
sound:Play()
end
end
game:GetService("UserInputService").InputBegan:connect(onKeyPress)
Does anyone know how to fix this error?

3 comments
I tried replicating this with your exact code, and it worked just fine. I placed the sound inside of a screengui (because why not), and then the script inside the sound. I pressed Q while in the game, and it worked. I used a LocalScript btw and I'm not sure if that's what you're using or not.
its the script the sound is played by Sound.Playing = True he using sound:Play() it took me a while to see it lol
im sorry for you responding I Have fixed it. And i guess it was just a studio issue. It has been resovled. Thank you