Help with my House System Script

Ello guys, how are ya?
well, since i started working on this project i’ve had some issues with my house script that i can’t solve.

Firstly I create a StringValue that takes the Plot the player is in and then the Player that owns the house.

local PlotV = Instance.new("StringValue", player)
PlotV.Name = "PlotValue"
PlotV.Value = PlayerPlot.Name

And then the description which is actually the “Text” I call it “HouseDescription”
I concatenate the player name to your plot

local HouseDescription = Instance.new("StringValue", player)
HouseDescription.Name = "HouseDescription"
HouseDescription.Value = player.Name .. " | " .. PlayerPlot.Name

Now, below is what I do to make it visible to players

local PlayerHouse = nil
				for _, houses in pairs(Houses) do
					local OwnerText = houses:FindFirstChild("Name").SurfaceGui.TextLabel
					if OwnerText then
						if OwnerText.Text == "Nothing" then
							OwnerText.Text = HouseDescription.Value
							PlayerHouse = houses
							return PlayerHouse
						end
					end
				end

now using PlayerRemoving() I do the following:

local PlayerHouse = nil
	for _, houses in pairs(Houses) do
	local CurrentPlayer = houses:FindFirstChild("Name").SurfaceGui.TextLabel
			if CurrentPlayer then
	if CurrentPlayer.Text == player:FindFirstChild("HouseDescription") then
		CurrentPlayer.Text = "Nothing"
	end
	end
	end
		return PlayerHouse
		end
			end
				end

–end)

But for some reason (as shown in the video below) the text doesn’t change to “Nothing”

Does anyone have any idea what might be going on?

Maybe because of this line:

if CurrentPlayer.Text == player:FindFirstChild("HouseDescription") then

That should be:

if player:FindFirstChild("HouseDescription") and CurrentPlayer.Text == player.HouseDescription.Value then

(You forgot a .Value and compared string with instance.)

it didn’t work, I think it’s because on the top lines the script broke; it would be a hypothesis, because when I try to print the values ​​they disappear (logically because the player exited) but I’m not sure if it worked, I’ll see what I can do

I will try to rewrite and use what you showed me, really, thank you very much