✓ Accepted answer
Your problem is that you're trying to use the Touched event with a model. This event is only supported for individual parts. No problem though, we can easily fix this to work with an entire model still.
Here's a little edit to your script that connects the event to every single part in the model:
function onTouch()
if not script.Parent.IsPlaying then
script.Parent:Play()
end
end
for i,v in pairs(game.Workspace.Model:GetChildren()) do
if v:IsA("BasePart") then
v.Touched:connect(onTouch)
end
end
I also fixed your connection. You need to include the event which is Touched , or else you're not connecting the function to anything properly.
Part:connect(onTouch)
Part.Touched:connect(onTouch)
And there you go. It's as simple as that. If you have any further problems/questions, please leave a comment below, and I'll see what I can do. Hope I helped :P