Argument 1 missing or nil while trying to get Sound name

I see, it’s only erroring the first time because it doesn’t have a value when .Changed is initially fired.

Add this to your function to check that the property has a value:

if not sound.SoundId then
    return
end
2 Likes

I think it might be an empty string, not nil, so I would check for the empty string instead. Checking both wouldn’t hurt though.

Sound.Changed:Connect(function()
	if not Sound.SoundId or Sound.SoundId == "" then
		return
	end

	-- ...
end)
2 Likes

It worked with it, thank you so much for helping

2 Likes