Sound Play on-touch script help?
I'm finding it hard to make a script, that allows each part named something, like for example grass, have a sound when you step on it. I made a script with a function, and well here it is:
function touch(hit)
function touch(hit)
if hit.Name == "Grass" then
end
end
script.Parent.Touched:connect(touch)
Workspace.sound.play()
wait(1)
Workspace.sound.play()
wait(1)
loop
end
Please help me with this script, maybe find some errors, i don't want a link to a model, i need help.
So am i doing anything wrong?