Error in output: 14:11:08.293 - Unable to cast value to Objects
--// Varialbes \\-- local player = game.Players.LocalPlayer local mouse = player:GetMouse() local tool = script.Parent tool.Equipped:Connect(function(equip) print("Player has equiped the gun!") mouse.Button1Down:Connect(function() local ray = Ray.new(tool.Handle.CFrame.p, (mouse.Hit.p - tool.Handle.CFrame.p).unit * 300) local part, position = workspace:FindPartOnRayWithIgnoreList(ray, player.Character) if part then print(part.Name) end end) end)
--// Varialbes \\-- local player = game.Players.LocalPlayer local mouse = player:GetMouse() local tool = script.Parent tool.Equipped:Connect(function(equip) print("Player has equiped the gun!") mouse.Button1Down:Connect(function() local ray = Ray.new(tool.Handle.CFrame.p, (mouse.Hit.p - tool.Handle.CFrame.p).unit * 300) local part, position = workspace:FindPartOnRayWithIgnoreList(ray, {player.Character}) if part then print(part.Name) end end) end)
When making a ray with an ignore list, the second parameter has to be a table.