Region Name GUI Isn't working

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
1 Like

Results will be empty since no player is in region, so th script never has a chance to put the inside variable back to false. Add region check for inside and a region check for outside simultaneously

1 Like