Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I make this script only destroy parts if it has one of multiple names?

function onTouched(hit)



hit:Destroy()



end







connection = script.Parent.Touched:connect(onTouched)

1 answer

You need to use the if command

function onTouched(hit) 02 if hit.name == "Custom name here" or hit.name == "Custom name here" then 03 04 05 hit:Destroy() 06 07 08 end 09 end

This discussion is preserved as it was. New answers, comments, and votes are closed.