Getting a Part from all the models in workplace for raycasting

Hi everyone, so I am creating a sensor system on a bus that can detect humanoid or a part called ‘BusTouched’ which is placed at the rear in the body of all my buses, It has visual and audio alert system in placed too. When I first started, I did a simple script using Touched:Connect. It did work but I face issues such as when a tween service is on going nearby, it will disturb the Touched:Connect causing a looping of the warning sound until the tween service has stopped. So I decided to change the script and use raycast to detect the part named ‘BusTouched’. However I am now stuck, the script below. Line 7 is the problem, the “workspace.Parent.Parent.BusTouched”. I am not sure what to type in there to get all the bus model with the part ‘BusTouched’ to be whitelisted. The grouping of the A-chassis for the bus is below the script.

local sensor = script.Parent

local origin = sensor.Position
local direction = sensor.CFrame.LookVector * 88

local raycastParams = RaycastParams.new()
raycastParams.FilterDescendantsInstances = {workspace.Parent.Parent.BusTouched}
raycastParams.FilterType = Enum.RaycastFilterType.Whitelist

local raycastResult = workspace:Raycast(origin, direction, raycastParams)

if raycastResult then
	script.Parent.Parent.Parent.Display.Screen.Collision:Play()
	script.Parent.Parent.Parent.Display.Screen.SurfaceGui.RedHeadway.Visible = true
	wait(0.25)
	script.Parent.Parent.Parent.Display.Screen.SurfaceGui.RedHeadway.Visible = false
	wait(0.25)
	script.Parent.Parent.Parent.Display.Screen.SurfaceGui.RedHeadway.Visible = true
	wait(0.25)
	script.Parent.Parent.Parent.Display.Screen.SurfaceGui.RedHeadway.Visible = false
	wait(0.25)
	script.Parent.Parent.Parent.Display.Screen.SurfaceGui.RedHeadway.Visible = true
	wait(0.1)
end

Screen Shot 2022-11-10 at 12.33.40 PM

I’ve tried using :GetDecendents but I am not sure how I can put it in to the raycast script and make it work.

CollectionService is great for this. Just tag all the parts you want with e.g. “BusWarningVolume”, then do

local TagS = game:GetService("CollectionService")
...
raycastParams.FilterDescendantsInstances = TagS:GetTagged("BusWarningVolume")

hm I am not sure where I am doing wrong as I’ve already tagged all the parts that needed to be whitelisted but i got this error message in the output when I paste the script in the command bar below. I’ve also tried putting samples of the tagged part in the workplace and it still did not detect it.

local tagS = game:GetService("CollectionService")

local sensor = script.Parent

local origin = sensor.Position
local direction = sensor.CFrame.LookVector * 88

local raycastParams = RaycastParams.new()
raycastParams.FilterDescendantsInstances = tagS:GetT:3: attempt to index nil with 'Parent'```

Uhhh not sure what’s going with that??