How do I make a sound play when a particular model enters the workspace?

Hello,

I’m trying to have an audio play as a map model enters the workspace from a folder in replicated storage, in accordance with my round-based system. I’ve seen other’s examples of how to achieve this, such as AsyncRith’s, though this doesn’t work for me, and I notice the forum is quite barren in regards to this topic. I feel as though this is something really straightforward but am really stumped at the moment as there aren’t any errors in the output. Any help is greatly appreciated.

Below is my script for critique:

local SoundService = game:GetService("SoundService")
local Sound1 = SoundService.Sound1

if game.Workspace:FindFirstChild("Map") then
	Sound1:Play()
	Sound1:Looped()
else
	Sound1:Stop()
end
game.Workspace.ChildAdded:Connect(function(child)
if child.Name == "map" then
print("map added")
sound:Play()
end end)

Wrote this on mobile, sorry for the formatting haha

3 Likes