Ey. Not that good with keydown scripts. Im trying to make it so that when you are driving, if you stop pressing the throttle (W key) then the sound will stop, similar to when you put your foot off the gas when driving, the engine isn't as loud. Not sure what I'm doing wrong.
Player = game.Players.LocalPlayer
Mouse = Player:GetMouse()
game:GetService("UserInputService").InputBegan:connect(function(input)
if input.KeyCode == Enum.KeyCode.W then
script.Parent.Parent.F1.Engine.Playing = true
end
end)
game:GetService("UserInputService").InputEnded:connect(function(input)
if input.KeyCode == Enum.KeyCode.W then
script.Parent.Parent.F1.Engine.Playing = false
end
end)

1 comment
You'd probably want to use :Play() and :Stop() respectively. Also, it's not loud because your volume settings are low/the sound's Volume property is low.