Help Me plss To my script

hello everyone plss help me on my script i dont know why i got error and i did properly the code here’s the code

local part = script.Parent
local myRay = Ray.new(part.Position , Vector3.new(0,50,0))

while wait(1) do
	local hit,position = workspace:FindPartOnRayWithIgnoreList(myRay, (part))
	if hit then
		print("Part!")
	else
		print("No Part!")
	end
end

and i got this error

13:26:50.926 - Unable to cast value to Objects
13:26:50.927 - Stack Begin
13:26:50.928 - Script ‘Workspace.Part.Script’, Line 5
13:26:50.928 - Stack End

You need to insert a Table as the ignore parameter. Instead of using (), use {} to signify that “part” is within a table.

local hit,position = workspace:FindPartOnRayWithIgnoreList(myRay, {part})
1 Like

OMG i spend so many time to solve this thank you so much :slight_smile:

1 Like