So I'm trying to get it so when you click it gets the part that is at the position of click and also only works if the parts name is defined in the table
I keep getting an error saying position is not a valid member of model at line 8
local names = {"Slab","Plate","Wall","CornerWall"}
Mouse.Button1Down:connect(function()
if script.Parent.Parent.MaterialPicker.Placing.Value == false then
local WorkspaceChildren = game.Workspace:GetChildren()
for i, v in pairs (WorkspaceChildren) do
if v.Name == names[1] or names[2] or names[3] or names[4] then
print("name pass")
if v.Position == Vector3.new(Mouse.Hit.p.X, Mouse.Hit.p.Z, Mouse.Hit.p.Y) then
print(Mouse.Hit.p.X, Mouse.Hit.p.Z, Mouse.Hit.p.Y)
end
end
end
end
end)
