Problem with the respawning system

Hello, I’ve made a respawn system that used to work before but for some reason now it suddenly broke, i have a part in each plot that indicates the spawn location for each plot owner, the code is supposed to loop through the plots till it finds the plot that has the designated player as its owner, after that its supposed to teleport the player to the plot when the player joins or dies and respawns… heres the code

local character = game.Workspace:WaitForChild(Player.Name)
		local hmrp = character:WaitForChild('HumanoidRootPart')
		local hum = character:WaitForChild('Humanoid')
		if plot:GetAttribute('Owner') ~= Player.UserId then continue end
		if plot:GetAttribute('Owner') == Player.UserId then
			local Spawner = plot:FindFirstChild('SpawnPoint')
		hmrp.CFrame = Spawner.CFrame
		
		Player.CharacterAdded:Connect(function(char)
			local humrp = char:WaitForChild('HumanoidRootPart')
			humrp.CFrame = Spawner.CFrame
			
		end)