local player = game.Players.LocalPlayer
local char = player.Character
local mouse = player:GetMouse()
start = script.startsound
off = script.offsound
on = script.On --boolvalue
mouse.KeyDown:Connect(function(key)
if key == "f" then
if on.Value == false then
if start.IsPlaying == false then
start:Play()
on.Value = true
elseif on.Value == true then
on.Value = false
off:Play()
end
end
end
end)
What I want this script to do is to play a sound in a specific order. A player presses f and the start sound plays. Then he presses f and the off sound plays. I tried using a boolvalue to toggle it but I didn't know how to use it with key functions.

2 comments
Thanks, I usually use keydown since it's more simple but I'll get into the new methods
Np. Browse the wiki for UserInputService to learn more about how it works and how to use it.