Title YouTube Video Code:
script.Parent.Touched:connect(function(hit) print(hit.Name) if hit.Name=="SynthPlay" then script.Parent.Sound:Play() end end)
I've seen the video. You've mispelled it.
You have the object in your workspace named "SnythPlay" instead of "SynthPlay". Be aware of spellings next time as it puts heavy problem/errors.
Try using this format from now on.
function onTouched(part) if part.Parent ~= nil then local h = part.Parent:findFirstChild(" Whatever object in workspace you want the script to detect on touch.") if h~=nil then --Do stuff script.Parent.Touched:connect(onTouched)
This should work for you:
script.Parent.Touched:Connect(function(hit) print(hit) if hit.Name == "d" then print("It works!") end end)
This was tested. Please upvote and accept my answer if it helped!