So uhm, I'm having a big problemo and I was wondering how can I make the script only execute when the specific block is touched for example, if brick "center" from a Vehicle touches the brick that has the touchinterest line.
function onTouched(hit) if debounce == false then debounce = true check = hit.Parent.Trucks1:FindFirstChild("Center") --this is where I get confused print ("Found TruckCenter") if check ~= nil then
Assuming you have your script in a part
local part = script.Parent part.Touched:Connect(function(hit) if hit.Parent:FindFirstChild('Trucks1'):FindFirstChild('Center') then -- Found it! end end)
You can also test the name but I just copied what you writed on line 4 (I added findfirstchild on trucks though as it might not exist)