I would recommend using ZonePlus for this, it’s pretty simple.
local Zone = require(script.Zone)
local myZone = Zone.fromRegion(CFrame.new(), Vector3.new(20, 20, 20))
myZone.playerEntered:Connect(function(player)
print(player.Name.." entered the region")
end)
myZone.playerExited:Connect(function(player)
print(player.Name.." left the region")
end)