function OnClicked(clicked)
local sound1 = Instance.new("Sound")
sound1.SoundId = "http://www.roblox.com/asset/?id=1571597070"
sound1.Looped = false
sound1.Volume = 0.5
local player = game.Players.LocalPlayer
local char = player.Character
local head = char:WaitForChild('Head')
sound1.Parent = head
sound1:play()
end
script.Parent.MouseButton1Click: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.

1 comment
ServerScript Used.