This shows the correct text when I first walk in, however, once I walk out and walk in again, nothing changes, the output is always “true”.
Any ideas?
while wait(1) do
print(inside)
local OverlapParameters = OverlapParams.new()
OverlapParameters.MaxParts = 100
local results = workspace:GetPartsInPart(Regions.District1, OverlapParameters)
if results then
for i, playersFound in pairs (results) do
inside = false
if playersFound:FindFirstAncestor(Player.Name) then
print("Player was found!")
inside = true
else
title.Parent.Enabled = false
inside = false
print("Player was found!")
end
end
if inside then
if title.Text ~= Regions.District1.Name then
title.Parent.Enabled = true
title.Text = Regions.District1.Name
end
end
end
end