I just want it to print out touched.Parent it use to react to everything that touched it now it doesn’t?
script.Parent.Touched:Connect(function(touched)
print(touched.Parent)
end)
I just want it to print out touched.Parent it use to react to everything that touched it now it doesn’t?
script.Parent.Touched:Connect(function(touched)
print(touched.Parent)
end)
So do you want to print the object value of the touches object or the name?
Just the name of the part it touched I tried touched.Parent.Name which didn’t work, it’s probably some small part of the code I missed but I have this and here’s what happens.
script.Parent.Touched:Connect(function(touched)
script.Parent:Destroy()
end)
https://gyazo.com/833ab2149017f9cd6afeca324eb9e4ec
It only reacts when it touches my character
Well touched only reacts when an unanchored or moving part touches the target part
oh, well how can I make it so when it touches anything it get destroyed?
Sorry but I’m not sure how you could do that. But also an off topic question, how do you do it so it does code like colored? (I’m new to the forum)
do you mean syntax highlighting?
– --code here --
this what you mean?
well what type of script is it? Can you send a picture of your hierarchy?
The script works perfectly for me
thats it i put it in a separate script, it’s also a server script
I mean send me a picture of your explorer tab
Here

It is in replicatedstorage so it will not show in the workspace.
put it in the workspace
Wdym it won’t show I parent it to the workspace when I clone it.
Quoting from the developer hub page:
The Touched event only fires when an unanchored part touches the part with the Touched event, which explains why it only fires when a player walks onto it.
In other words…
script.Parent.Touched:Connect(function(touched) -- Part with the Touched Thing
print(touched) -- It Must be unanchored
end)
Yeah, I figured that out but it still doesn’t solve my problem.