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

Reloading Sound doesn't play?

Asked by
62_113 0
2 years ago

Well, I've tried to make a sound play whenever you actually press R, considering I am pretty new to this, it'd be great to get help, thanks!

game:GetService("UserInputService").InputBegan:connect(function(inputObject, gameProcessedEvent)
    if inputObject.KeyCode == Enum.KeyCode.R then
        script.Parent.reload:Play()
    end 
end)

The Code is also in a LocalScript.

1 answer

Log in to vote
1
Answered by 2 years ago

Add a print before the sound plays.

If it prints, then that means that the issue is the sound ID not being correct / not working, or the sound might not even be there.

If it doesn't print, then your key pressed script is incorrect.

1
The location of the script could also be incorrect. This should go inside of StarterPlayerScripts DietCokeTastesGood 111 — 2y
Ad

Answer this question