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?