My table isn't working

Hello, there is a table in my script, but it doesn’t seem to work. The output doesn’t print any errors or warnings. How can this script be fixed?

Here is the script:

local rightSensorTable = {}
local leftSensorTable = {}
local touchingRightSensor = rightSensor:GetTouchingParts()
local touchingLeftSensor = leftSensor:GetTouchingParts()

for i, v in pairs(touchingRightSensor) do
	print(v)
	table.insert(rightSensorTable, v)
end

for i, v in pairs(touchingLeftSensor) do
	print(v)
	table.insert(leftSensorTable, v)
end

if table.find(touchingRightSensor, road) then
	right = true
else
	right = false
end

if table.find(touchingLeftSensor, road) then
	left = true
else
	left = false
end

Are you sure that :GetTouchingParts table isn’t blank?

1 Like

What do you mean by this?

I made a table in the script,

local rightSensorTable = {}
local leftSensorTable = {}

I actually meant these tables.

1 Like