Hi. Im making a field system where when you enter a field, it sets your value to the field name, and when exited, removes said value.
Thing is, if a field has the same name beside each other, it glitches out and only sets the field to blank.
Been trying to fix it all day and cant figure it out. Note: Im using zonePlus for this. ZonePlus v3.2.0 | Construct dynamic zones and effectively determine players and parts within their boundaries
local check = false
for _, v1 in pairs(workspace.FieldBoxes:GetChildren()) do
local zone = require(game.ServerScriptService.Zone).new(v1)
zone.playerEntered:Connect(function(player)
if check then return end
check = true
player.Field.Value = v1.Name
end)
zone.playerExited:Connect(function(player)
if not check then return end
check = false
player.Field.Value = ''
end)
end