Basically, I'm trying to make an object disappear when it touches a certain part. Whenever it touches it, it doesn't work. I used a print script to see if there's an error. However, my script prints out the error message but roblox doesn't. How do I get this to destroy?
Script:
script.Parent.Yummy.Touched:Connect(function(eaten)
if eaten.Parent.Name == "Eat" then
script.Parent:Destroy()
else
print("error!")
end
end)

5 comments
????
what are you trying to solve? i dont know what when it touches and object the object dissapears mean
so basically when a part touches a certain part, it gets destroyed
if it prints then it probably means it works
if it prints then its not working