Hello there. I'm trying to make a local script so that whenever a player enters a house, a gui will show whose house it is.
local houseRegions = game.Workspace:WaitForChild("HouseRegions")
local found = false
while wait(1) do
for i, v in pairs(houseRegions:GetChildren()) do
found = false
local region = Region3.new(v.Position - (v.Size/2), v.Position + (v.Size/2))
local parts = workspace:FindPartsInRegion3WithWhiteList(region, game.Players.LocalPlayer.Character:GetDescendants())
for _, part in pairs(parts) do
if part:FindFirstAncestor(game.Players.LocalPlayer.Name) then
found = true
break
else
found = false
end
end
if found then
if script.Parent.HouseRegions[v.Name] then
script.Parent.House.TextLabel.Text = script.Parent.HouseRegions[v.Name].Value -- it's a string value stored inside a folder called HouseRegions in the starterGui.
script.Parent.House.TextLabel.Visible = true
for i = 1, 0, -0.1 do
script.Parent.House.TextLabel.TextTransparency = i
wait(0.05)
end
wait(1)
for i = 0, 1, 0.1 do
script.Parent.House.TextLabel.TextTransparency = i
wait(0.05)
end
script.Parent.House.TextLabel.Visible = false
break
end
else
script.Parent.House.TextLabel.Text = script.Parent.Mapleburg.Value -- string value
script.Parent.House.TextLabel.Visible = true
for i = 1, 0, -0.1 do
script.Parent.House.TextLabel.TextTransparency = i
wait(0.05)
end
wait(1)
for i = 0, 1, 0.1 do
script.Parent.House.TextLabel.TextTransparency = i
wait(0.05)
end
script.Parent.House.TextLabel.Visible = false
end
end
end
Everything seems to be working, but the gui that indicates the stuff keeps appearing. (yes I've tried a replica of alvinblox's region3 tutorial.)

3 comments
Your only breaking the for loop, not the while wait loop
Which line is it?
it's not an error. the script works fine but the screengui keeps appearing even though i break the for loop.