local debounce = false
local region = Region3.new(Vector3.new(270.019, 81, -18.913), Vector3.new(275.805, 95.279, -12.586))
while true do
wait()
local hitregion= workspace:FindPartsInRegion3(region)
for i, hit in pairs(hitregion) do
if hit.Parent:FindFirstChild("Humanoid") and debounce == false then
debounce = true
print("region entered ("..part.Parent.Name..")")
script.Parent.BrickColor = BrickColor.new("Black")
wait(2)
else
script.Parent.BrickColor = BrickColor.new("Persimmon")
end
end
debounce = false
end
The Region3 does not touch any part other than a child of the player at any point and the color quickly flashes shortly after the debounce refreshes. How can I make the while loop have a constant color while the player is in the region throughout?
