When a door is touched in my game, I want music to play:
--Vaiables
local Sensor = script.Parent.Sensor
local Door = script.Parent["Prison Side Door 1"]
local Window = script.Parent.Window
local Player = game.Players.LocalPlayer
local Light = script.Parent.Light
--make the sound ID
local music Instance.new("Sound",Player)
music.SoundId = "rbxassetid://993959716"
music.Name = "AMusic"
--Function for everything
local function Everything(part)
local hum = game.Workspace:FindFirstChild("Humanoid")
print(hum)
music:Play()
end
Sensor.Touched:Connect(Everything)
When run It gives an error:
14:38:13.419 - Workspace.Regions.City.Prison.Police Station.Floor 1.Doors.Prison Side Door 1.The Door Opener:10: attempt to index local 'music' (a nil value)
Can someone help me with the error?

1 comment
local music Instance.new("Sound",Player) should be local music = Instance.new("Sound",Player) ur missing an '='