local AllPlots = workspace.Plots:GetChildren()
for i, v in pairs(AllPlots) do
if v[i].ClaimDoor.Rig.Rig.OwnerName.Value == "" then -- Plot is empty
v[i].ClaimDoor.Rig.Rig.OwnerName.Value = Plr.Name
workspace:WaitForChild(Plr.Name).PrimaryPart.CFrame = v[i].PrimaryPart.CFrame
break
end
end
I was using this code from another answer, but it does not work.

3 comments
how does this code not work? eg. are any errors showing that could explain why your code isn't functioning properly
yes
it says 1 is not a valid member