I have sounds playing with 0 pitch in the PlayerGUI so this script below which is in a GUI button, when pressed it should be changing the Pitch of the sound to 1, but for some reason it's not working.
local plr = script.Parent.Parent.Parent.Parent
function onClick(mouse)
player.PlayerGui.Music.Pitch = 1
end
script.Parent.MouseButton1Click:connect(onClick)
In the output I'm getting:
22:29:31.728 - Players.Player1.PlayerGui.ScreenGui.TextButton.script:4: attempt to index global 'player' (a nil value)
22:29:31.732 - Stack Begin
22:29:31.733 - Script 'Players.Player1.PlayerGui.ScreenGui.TextButton.script', Line 4
22:29:31.734 - Stack End

1 comment
thanks alot!!