i added music in my simulator game and i want to make a button to make the music stop and start if the press it again. but it says: attempt to index local 'input' (a boolean value)
my code:
game:GetService("UserInputService").InputBegan:Connect(function(player, input)
if input.KeyCode == Enum.KeyCode.m then
game.Workspace.Sound:Stop()
end
end)
game:GetService("UserInputService").InputBegan:Connect(function(player, input)
if input.KeyCode == Enum.KeyCode.m then
game.Workspace.Sound:Play()
end
end)

5 comments
it says: unexpected symbol near ')'
on what line, you could give more info before downvoting me
line 13
btw i dont have enough reputation to downvote
now try it, edited