Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Audio script not playing anything?

Asked by 6 years ago
Edited 6 years ago

I am wondering if there is a script that you can put inside a morph that allows you to press a certain key to play a certain piece of audio, so I could use it to play voice lines and stuff like that. I already attempted this but failed miserably. If someone could help me out with this that would be greatly appreciated.

EDIT: Would it be something like this?

function onKeyPress(inputObject, gameProcessedEvent)
if inputObject.KeyCode == Enum.KeyCode.F then
        local Sound = Instance.new("Sound", workspace)
                 Sound.SoundId = "rbxassetid://610752029"
                 Sound:Play()
end
end
game:GetService("UserInputService").InputBegan:connect(onKeyPress)
0
Must need changed because it doesn't work in the workspace or inside the morph Fangs020 2 — 6y

Answer this question