My sound to head through GUI click wont work. How do I fix this?
01 | function OnClicked(clicked) |
02 | local sound 1 = Instance.new( "Sound" ) |
06 | local player = game.Players.LocalPlayer |
07 | local char = player.Character |
08 | local head = char:WaitForChild( 'Head' ) |
12 | script.Parent.MouseButton 1 Click:connect(OnClicked) |
An error in the output keeps showing up saying "00:01:17.299 - Players.Zvtu.PlayerGui.ScreenGui.Frame.TextButton.Script:7: attempt to index local 'player' (a nil value)". What does that mean? How do I make this script so the sound plays through the players head? Any help would be appreciated.